From 58d29abfaada55c1f060e201f661d22664279004 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Wed, 10 Aug 2022 11:44:07 +0200 Subject: [PATCH] Add [UnscopedRef] support to HLSL matrix types --- .../Primitives/Bool/BoolMxN.g.cs | 1130 ++++++++++------- .../Primitives/Double/DoubleMxN.g.cs | 368 ++++-- .../Primitives/Float/FloatMxN.g.cs | 368 ++++-- .../Primitives/Int/IntMxN.g.cs | 368 ++++-- .../Primitives/MatrixType.ttinclude | 12 +- .../Primitives/UInt/UIntMxN.g.cs | 368 ++++-- 6 files changed, 1720 insertions(+), 894 deletions(-) diff --git a/src/ComputeSharp.Core/Primitives/Bool/BoolMxN.g.cs b/src/ComputeSharp.Core/Primitives/Bool/BoolMxN.g.cs index 954a4df4..4ab22441 100644 --- a/src/ComputeSharp.Core/Primitives/Bool/BoolMxN.g.cs +++ b/src/ComputeSharp.Core/Primitives/Bool/BoolMxN.g.cs @@ -1,8 +1,8 @@ -using System.Runtime.CompilerServices; +using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif #pragma warning disable CS0660, CS0661 @@ -19,7 +19,7 @@ public unsafe partial struct Bool1x1 private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool1x1), sizeof(Bool4)); [FieldOffset(0)] - private int m11; + private bool m11; /// /// Creates a new instance with the specified parameters. @@ -27,7 +27,7 @@ public unsafe partial struct Bool1x1 /// The value to assign to the component at position [1, 1]. public Bool1x1(bool m11) { - this.m11 = m11 ? 1 : 0; + this.m11 = m11; } /// @@ -35,6 +35,7 @@ public unsafe partial struct Bool1x1 /// /// 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. + [UnscopedRef] public readonly ref bool this[int row] => ref *(bool*)UndefinedData; /// @@ -43,6 +44,7 @@ public unsafe partial struct Bool1x1 /// 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. + [UnscopedRef] public readonly ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; /// @@ -52,6 +54,7 @@ public unsafe partial struct Bool1x1 /// 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. + [UnscopedRef] public readonly ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; /// @@ -62,12 +65,14 @@ public unsafe partial struct Bool1x1 /// 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. + [UnscopedRef] 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.As(ref Unsafe.AsRef(in this.m11)), 1)); + [UnscopedRef] + public readonly ref bool M11 => ref this.m11; /// /// Creates a new value with the same value for all its components. @@ -77,7 +82,7 @@ public unsafe partial struct Bool1x1 { Bool1x1 matrix; - matrix.m11 = x ? 1 : 0; + matrix.m11 = x; return matrix; } @@ -145,10 +150,10 @@ public unsafe partial struct Bool1x2 private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool1x2), sizeof(Bool4)); [FieldOffset(0)] - private int m11; + private bool m11; [FieldOffset(4)] - private int m12; + private bool m12; /// /// Creates a new instance with the specified parameters. @@ -157,8 +162,8 @@ public unsafe partial struct Bool1x2 /// The value to assign to the component at position [1, 2]. public Bool1x2(bool m11, bool m12) { - this.m11 = m11 ? 1 : 0; - this.m12 = m12 ? 1 : 0; + this.m11 = m11; + this.m12 = m12; } /// @@ -166,6 +171,7 @@ public unsafe partial struct Bool1x2 /// /// 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. + [UnscopedRef] public readonly ref Bool2 this[int row] => ref *(Bool2*)UndefinedData; /// @@ -174,6 +180,7 @@ public unsafe partial struct Bool1x2 /// 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. + [UnscopedRef] public readonly ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; /// @@ -183,6 +190,7 @@ public unsafe partial struct Bool1x2 /// 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. + [UnscopedRef] public readonly ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; /// @@ -193,17 +201,20 @@ public unsafe partial struct Bool1x2 /// 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. + [UnscopedRef] 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.As(ref Unsafe.AsRef(in this.m11)), 1)); + [UnscopedRef] + public readonly ref bool M11 => ref this.m11; /// /// 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.As(ref Unsafe.AsRef(in this.m12)), 1)); + [UnscopedRef] + public readonly ref bool M12 => ref this.m12; /// /// Creates a new value with the same value for all its components. @@ -213,8 +224,8 @@ public unsafe partial struct Bool1x2 { Bool1x2 matrix; - matrix.m11 = x ? 1 : 0; - matrix.m12 = x ? 1 : 0; + matrix.m11 = x; + matrix.m12 = x; return matrix; } @@ -288,13 +299,13 @@ public unsafe partial struct Bool1x3 private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool1x3), sizeof(Bool4)); [FieldOffset(0)] - private int m11; + private bool m11; [FieldOffset(4)] - private int m12; + private bool m12; [FieldOffset(8)] - private int m13; + private bool m13; /// /// Creates a new instance with the specified parameters. @@ -304,9 +315,9 @@ public unsafe partial struct Bool1x3 /// The value to assign to the component at position [1, 3]. public Bool1x3(bool m11, bool m12, bool m13) { - this.m11 = m11 ? 1 : 0; - this.m12 = m12 ? 1 : 0; - this.m13 = m13 ? 1 : 0; + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; } /// @@ -314,6 +325,7 @@ public unsafe partial struct Bool1x3 /// /// 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. + [UnscopedRef] public readonly ref Bool3 this[int row] => ref *(Bool3*)UndefinedData; /// @@ -322,6 +334,7 @@ public unsafe partial struct Bool1x3 /// 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. + [UnscopedRef] public readonly ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; /// @@ -331,6 +344,7 @@ public unsafe partial struct Bool1x3 /// 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. + [UnscopedRef] public readonly ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; /// @@ -341,22 +355,26 @@ public unsafe partial struct Bool1x3 /// 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. + [UnscopedRef] 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.As(ref Unsafe.AsRef(in this.m11)), 1)); + [UnscopedRef] + public readonly ref bool M11 => ref this.m11; /// /// 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.As(ref Unsafe.AsRef(in this.m12)), 1)); + [UnscopedRef] + public readonly ref bool M12 => ref this.m12; /// /// 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.As(ref Unsafe.AsRef(in this.m13)), 1)); + [UnscopedRef] + public readonly ref bool M13 => ref this.m13; /// /// Creates a new value with the same value for all its components. @@ -366,9 +384,9 @@ public unsafe partial struct Bool1x3 { Bool1x3 matrix; - matrix.m11 = x ? 1 : 0; - matrix.m12 = x ? 1 : 0; - matrix.m13 = x ? 1 : 0; + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; return matrix; } @@ -442,16 +460,16 @@ public unsafe partial struct Bool1x4 private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool1x4), sizeof(Bool4)); [FieldOffset(0)] - private int m11; + private bool m11; [FieldOffset(4)] - private int m12; + private bool m12; [FieldOffset(8)] - private int m13; + private bool m13; [FieldOffset(12)] - private int m14; + private bool m14; /// /// Creates a new instance with the specified parameters. @@ -462,10 +480,10 @@ public unsafe partial struct Bool1x4 /// The value to assign to the component at position [1, 4]. public Bool1x4(bool m11, bool m12, bool m13, bool m14) { - this.m11 = m11 ? 1 : 0; - this.m12 = m12 ? 1 : 0; - this.m13 = m13 ? 1 : 0; - this.m14 = m14 ? 1 : 0; + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; } /// @@ -473,6 +491,7 @@ public unsafe partial struct Bool1x4 /// /// 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. + [UnscopedRef] public readonly ref Bool4 this[int row] => ref *(Bool4*)UndefinedData; /// @@ -481,6 +500,7 @@ public unsafe partial struct Bool1x4 /// 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. + [UnscopedRef] public readonly ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; /// @@ -490,6 +510,7 @@ public unsafe partial struct Bool1x4 /// 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. + [UnscopedRef] public readonly ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; /// @@ -500,27 +521,32 @@ public unsafe partial struct Bool1x4 /// 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. + [UnscopedRef] 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.As(ref Unsafe.AsRef(in this.m11)), 1)); + [UnscopedRef] + public readonly ref bool M11 => ref this.m11; /// /// 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.As(ref Unsafe.AsRef(in this.m12)), 1)); + [UnscopedRef] + public readonly ref bool M12 => ref this.m12; /// /// 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.As(ref Unsafe.AsRef(in this.m13)), 1)); + [UnscopedRef] + public readonly ref bool M13 => ref this.m13; /// /// 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.As(ref Unsafe.AsRef(in this.m14)), 1)); + [UnscopedRef] + public readonly ref bool M14 => ref this.m14; /// /// Creates a new value with the same value for all its components. @@ -530,10 +556,10 @@ public unsafe partial struct Bool1x4 { Bool1x4 matrix; - matrix.m11 = x ? 1 : 0; - matrix.m12 = x ? 1 : 0; - matrix.m13 = x ? 1 : 0; - matrix.m14 = x ? 1 : 0; + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; return matrix; } @@ -607,10 +633,10 @@ public unsafe partial struct Bool2x1 private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool2x1), sizeof(Bool4)); [FieldOffset(0)] - private int m11; + private bool m11; [FieldOffset(4)] - private int m21; + private bool m21; /// /// Creates a new instance with the specified parameters. @@ -619,8 +645,8 @@ public unsafe partial struct Bool2x1 /// The value to assign to the component at position [2, 1]. public Bool2x1(bool m11, bool m21) { - this.m11 = m11 ? 1 : 0; - this.m21 = m21 ? 1 : 0; + this.m11 = m11; + this.m21 = m21; } /// @@ -628,6 +654,7 @@ public unsafe partial struct Bool2x1 /// /// 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. + [UnscopedRef] public readonly ref bool this[int row] => ref *(bool*)UndefinedData; /// @@ -636,6 +663,7 @@ public unsafe partial struct Bool2x1 /// 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. + [UnscopedRef] public readonly ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; /// @@ -645,6 +673,7 @@ public unsafe partial struct Bool2x1 /// 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. + [UnscopedRef] public readonly ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; /// @@ -655,17 +684,20 @@ public unsafe partial struct Bool2x1 /// 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. + [UnscopedRef] 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.As(ref Unsafe.AsRef(in this.m11)), 1)); + [UnscopedRef] + public readonly ref bool M11 => ref this.m11; /// /// 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.As(ref Unsafe.AsRef(in this.m21)), 1)); + [UnscopedRef] + public readonly ref bool M21 => ref this.m21; /// /// Creates a new value with the same value for all its components. @@ -675,8 +707,8 @@ public unsafe partial struct Bool2x1 { Bool2x1 matrix; - matrix.m11 = x ? 1 : 0; - matrix.m21 = x ? 1 : 0; + matrix.m11 = x; + matrix.m21 = x; return matrix; } @@ -750,16 +782,16 @@ public unsafe partial struct Bool2x2 private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool2x2), sizeof(Bool4)); [FieldOffset(0)] - private int m11; + private bool m11; [FieldOffset(4)] - private int m12; + private bool m12; [FieldOffset(8)] - private int m21; + private bool m21; [FieldOffset(12)] - private int m22; + private bool m22; /// /// Creates a new instance with the specified parameters. @@ -770,10 +802,10 @@ public unsafe partial struct Bool2x2 /// The value to assign to the component at position [2, 2]. public Bool2x2(bool m11, bool m12, bool m21, bool m22) { - this.m11 = m11 ? 1 : 0; - this.m12 = m12 ? 1 : 0; - this.m21 = m21 ? 1 : 0; - this.m22 = m22 ? 1 : 0; + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; } /// @@ -783,10 +815,10 @@ public unsafe partial struct Bool2x2 /// The value to assign to the row at position [2]. public Bool2x2(Bool2 row1, Bool2 row2) { - this.m11 = row1.X ? 1 : 0; - this.m12 = row1.Y ? 1 : 0; - this.m21 = row2.X ? 1 : 0; - this.m22 = row2.Y ? 1 : 0; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; } /// @@ -794,6 +826,7 @@ public unsafe partial struct Bool2x2 /// /// 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. + [UnscopedRef] public readonly ref Bool2 this[int row] => ref *(Bool2*)UndefinedData; /// @@ -802,6 +835,7 @@ public unsafe partial struct Bool2x2 /// 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. + [UnscopedRef] public readonly ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; /// @@ -811,6 +845,7 @@ public unsafe partial struct Bool2x2 /// 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. + [UnscopedRef] public readonly ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; /// @@ -821,27 +856,32 @@ public unsafe partial struct Bool2x2 /// 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. + [UnscopedRef] 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.As(ref Unsafe.AsRef(in this.m11)), 1)); + [UnscopedRef] + public readonly ref bool M11 => ref this.m11; /// /// 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.As(ref Unsafe.AsRef(in this.m12)), 1)); + [UnscopedRef] + public readonly ref bool M12 => ref this.m12; /// /// 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.As(ref Unsafe.AsRef(in this.m21)), 1)); + [UnscopedRef] + public readonly ref bool M21 => ref this.m21; /// /// 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.As(ref Unsafe.AsRef(in this.m22)), 1)); + [UnscopedRef] + public readonly ref bool M22 => ref this.m22; /// /// Creates a new value with the same value for all its components. @@ -851,10 +891,10 @@ public unsafe partial struct Bool2x2 { Bool2x2 matrix; - matrix.m11 = x ? 1 : 0; - matrix.m12 = x ? 1 : 0; - matrix.m21 = x ? 1 : 0; - matrix.m22 = x ? 1 : 0; + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; return matrix; } @@ -922,22 +962,22 @@ public unsafe partial struct Bool2x3 private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool2x3), sizeof(Bool4)); [FieldOffset(0)] - private int m11; + private bool m11; [FieldOffset(4)] - private int m12; + private bool m12; [FieldOffset(8)] - private int m13; + private bool m13; [FieldOffset(12)] - private int m21; + private bool m21; [FieldOffset(16)] - private int m22; + private bool m22; [FieldOffset(20)] - private int m23; + private bool m23; /// /// Creates a new instance with the specified parameters. @@ -950,12 +990,12 @@ public unsafe partial struct Bool2x3 /// 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 ? 1 : 0; - this.m12 = m12 ? 1 : 0; - this.m13 = m13 ? 1 : 0; - this.m21 = m21 ? 1 : 0; - this.m22 = m22 ? 1 : 0; - this.m23 = m23 ? 1 : 0; + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; } /// @@ -965,12 +1005,12 @@ public unsafe partial struct Bool2x3 /// The value to assign to the row at position [2]. public Bool2x3(Bool3 row1, Bool3 row2) { - this.m11 = row1.X ? 1 : 0; - this.m12 = row1.Y ? 1 : 0; - this.m13 = row1.Z ? 1 : 0; - this.m21 = row2.X ? 1 : 0; - this.m22 = row2.Y ? 1 : 0; - this.m23 = row2.Z ? 1 : 0; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; } /// @@ -978,6 +1018,7 @@ public unsafe partial struct Bool2x3 /// /// 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. + [UnscopedRef] public readonly ref Bool3 this[int row] => ref *(Bool3*)UndefinedData; /// @@ -986,6 +1027,7 @@ public unsafe partial struct Bool2x3 /// 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. + [UnscopedRef] public readonly ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; /// @@ -995,6 +1037,7 @@ public unsafe partial struct Bool2x3 /// 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. + [UnscopedRef] public readonly ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; /// @@ -1005,37 +1048,44 @@ public unsafe partial struct Bool2x3 /// 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. + [UnscopedRef] 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.As(ref Unsafe.AsRef(in this.m11)), 1)); + [UnscopedRef] + public readonly ref bool M11 => ref this.m11; /// /// 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.As(ref Unsafe.AsRef(in this.m12)), 1)); + [UnscopedRef] + public readonly ref bool M12 => ref this.m12; /// /// 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.As(ref Unsafe.AsRef(in this.m13)), 1)); + [UnscopedRef] + public readonly ref bool M13 => ref this.m13; /// /// 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.As(ref Unsafe.AsRef(in this.m21)), 1)); + [UnscopedRef] + public readonly ref bool M21 => ref this.m21; /// /// 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.As(ref Unsafe.AsRef(in this.m22)), 1)); + [UnscopedRef] + public readonly ref bool M22 => ref this.m22; /// /// 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.As(ref Unsafe.AsRef(in this.m23)), 1)); + [UnscopedRef] + public readonly ref bool M23 => ref this.m23; /// /// Creates a new value with the same value for all its components. @@ -1045,12 +1095,12 @@ public unsafe partial struct Bool2x3 { Bool2x3 matrix; - matrix.m11 = x ? 1 : 0; - matrix.m12 = x ? 1 : 0; - matrix.m13 = x ? 1 : 0; - matrix.m21 = x ? 1 : 0; - matrix.m22 = x ? 1 : 0; - matrix.m23 = x ? 1 : 0; + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; return matrix; } @@ -1118,28 +1168,28 @@ public unsafe partial struct Bool2x4 private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool2x4), sizeof(Bool4)); [FieldOffset(0)] - private int m11; + private bool m11; [FieldOffset(4)] - private int m12; + private bool m12; [FieldOffset(8)] - private int m13; + private bool m13; [FieldOffset(12)] - private int m14; + private bool m14; [FieldOffset(16)] - private int m21; + private bool m21; [FieldOffset(20)] - private int m22; + private bool m22; [FieldOffset(24)] - private int m23; + private bool m23; [FieldOffset(28)] - private int m24; + private bool m24; /// /// Creates a new instance with the specified parameters. @@ -1154,14 +1204,14 @@ public unsafe partial struct Bool2x4 /// 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 ? 1 : 0; - this.m12 = m12 ? 1 : 0; - this.m13 = m13 ? 1 : 0; - this.m14 = m14 ? 1 : 0; - this.m21 = m21 ? 1 : 0; - this.m22 = m22 ? 1 : 0; - this.m23 = m23 ? 1 : 0; - this.m24 = m24 ? 1 : 0; + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; } /// @@ -1171,14 +1221,14 @@ public unsafe partial struct Bool2x4 /// The value to assign to the row at position [2]. public Bool2x4(Bool4 row1, Bool4 row2) { - this.m11 = row1.X ? 1 : 0; - this.m12 = row1.Y ? 1 : 0; - this.m13 = row1.Z ? 1 : 0; - this.m14 = row1.W ? 1 : 0; - this.m21 = row2.X ? 1 : 0; - this.m22 = row2.Y ? 1 : 0; - this.m23 = row2.Z ? 1 : 0; - this.m24 = row2.W ? 1 : 0; + 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; } /// @@ -1186,6 +1236,7 @@ public unsafe partial struct Bool2x4 /// /// 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. + [UnscopedRef] public readonly ref Bool4 this[int row] => ref *(Bool4*)UndefinedData; /// @@ -1194,6 +1245,7 @@ public unsafe partial struct Bool2x4 /// 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. + [UnscopedRef] public readonly ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; /// @@ -1203,6 +1255,7 @@ public unsafe partial struct Bool2x4 /// 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. + [UnscopedRef] public readonly ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; /// @@ -1213,47 +1266,56 @@ public unsafe partial struct Bool2x4 /// 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. + [UnscopedRef] 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.As(ref Unsafe.AsRef(in this.m11)), 1)); + [UnscopedRef] + public readonly ref bool M11 => ref this.m11; /// /// 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.As(ref Unsafe.AsRef(in this.m12)), 1)); + [UnscopedRef] + public readonly ref bool M12 => ref this.m12; /// /// 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.As(ref Unsafe.AsRef(in this.m13)), 1)); + [UnscopedRef] + public readonly ref bool M13 => ref this.m13; /// /// 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.As(ref Unsafe.AsRef(in this.m14)), 1)); + [UnscopedRef] + public readonly ref bool M14 => ref this.m14; /// /// 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.As(ref Unsafe.AsRef(in this.m21)), 1)); + [UnscopedRef] + public readonly ref bool M21 => ref this.m21; /// /// 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.As(ref Unsafe.AsRef(in this.m22)), 1)); + [UnscopedRef] + public readonly ref bool M22 => ref this.m22; /// /// 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.As(ref Unsafe.AsRef(in this.m23)), 1)); + [UnscopedRef] + public readonly ref bool M23 => ref this.m23; /// /// 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.As(ref Unsafe.AsRef(in this.m24)), 1)); + [UnscopedRef] + public readonly ref bool M24 => ref this.m24; /// /// Creates a new value with the same value for all its components. @@ -1263,14 +1325,14 @@ public unsafe partial struct Bool2x4 { Bool2x4 matrix; - matrix.m11 = x ? 1 : 0; - matrix.m12 = x ? 1 : 0; - matrix.m13 = x ? 1 : 0; - matrix.m14 = x ? 1 : 0; - matrix.m21 = x ? 1 : 0; - matrix.m22 = x ? 1 : 0; - matrix.m23 = x ? 1 : 0; - matrix.m24 = x ? 1 : 0; + 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; } @@ -1338,13 +1400,13 @@ public unsafe partial struct Bool3x1 private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool3x1), sizeof(Bool4)); [FieldOffset(0)] - private int m11; + private bool m11; [FieldOffset(4)] - private int m21; + private bool m21; [FieldOffset(8)] - private int m31; + private bool m31; /// /// Creates a new instance with the specified parameters. @@ -1354,9 +1416,9 @@ public unsafe partial struct Bool3x1 /// The value to assign to the component at position [3, 1]. public Bool3x1(bool m11, bool m21, bool m31) { - this.m11 = m11 ? 1 : 0; - this.m21 = m21 ? 1 : 0; - this.m31 = m31 ? 1 : 0; + this.m11 = m11; + this.m21 = m21; + this.m31 = m31; } /// @@ -1364,6 +1426,7 @@ public unsafe partial struct Bool3x1 /// /// 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. + [UnscopedRef] public readonly ref bool this[int row] => ref *(bool*)UndefinedData; /// @@ -1372,6 +1435,7 @@ public unsafe partial struct Bool3x1 /// 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. + [UnscopedRef] public readonly ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; /// @@ -1381,6 +1445,7 @@ public unsafe partial struct Bool3x1 /// 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. + [UnscopedRef] public readonly ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; /// @@ -1391,22 +1456,26 @@ public unsafe partial struct Bool3x1 /// 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. + [UnscopedRef] 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.As(ref Unsafe.AsRef(in this.m11)), 1)); + [UnscopedRef] + public readonly ref bool M11 => ref this.m11; /// /// 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.As(ref Unsafe.AsRef(in this.m21)), 1)); + [UnscopedRef] + public readonly ref bool M21 => ref this.m21; /// /// 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.As(ref Unsafe.AsRef(in this.m31)), 1)); + [UnscopedRef] + public readonly ref bool M31 => ref this.m31; /// /// Creates a new value with the same value for all its components. @@ -1416,9 +1485,9 @@ public unsafe partial struct Bool3x1 { Bool3x1 matrix; - matrix.m11 = x ? 1 : 0; - matrix.m21 = x ? 1 : 0; - matrix.m31 = x ? 1 : 0; + matrix.m11 = x; + matrix.m21 = x; + matrix.m31 = x; return matrix; } @@ -1492,22 +1561,22 @@ public unsafe partial struct Bool3x2 private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool3x2), sizeof(Bool4)); [FieldOffset(0)] - private int m11; + private bool m11; [FieldOffset(4)] - private int m12; + private bool m12; [FieldOffset(8)] - private int m21; + private bool m21; [FieldOffset(12)] - private int m22; + private bool m22; [FieldOffset(16)] - private int m31; + private bool m31; [FieldOffset(20)] - private int m32; + private bool m32; /// /// Creates a new instance with the specified parameters. @@ -1520,12 +1589,12 @@ public unsafe partial struct Bool3x2 /// 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 ? 1 : 0; - this.m12 = m12 ? 1 : 0; - this.m21 = m21 ? 1 : 0; - this.m22 = m22 ? 1 : 0; - this.m31 = m31 ? 1 : 0; - this.m32 = m32 ? 1 : 0; + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + this.m31 = m31; + this.m32 = m32; } /// @@ -1536,12 +1605,12 @@ public unsafe partial struct Bool3x2 /// The value to assign to the row at position [3]. public Bool3x2(Bool2 row1, Bool2 row2, Bool2 row3) { - this.m11 = row1.X ? 1 : 0; - this.m12 = row1.Y ? 1 : 0; - this.m21 = row2.X ? 1 : 0; - this.m22 = row2.Y ? 1 : 0; - this.m31 = row3.X ? 1 : 0; - this.m32 = row3.Y ? 1 : 0; + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m31 = row3.X; + this.m32 = row3.Y; } /// @@ -1549,6 +1618,7 @@ public unsafe partial struct Bool3x2 /// /// 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. + [UnscopedRef] public readonly ref Bool2 this[int row] => ref *(Bool2*)UndefinedData; /// @@ -1557,6 +1627,7 @@ public unsafe partial struct Bool3x2 /// 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. + [UnscopedRef] public readonly ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; /// @@ -1566,6 +1637,7 @@ public unsafe partial struct Bool3x2 /// 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. + [UnscopedRef] public readonly ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; /// @@ -1576,37 +1648,44 @@ public unsafe partial struct Bool3x2 /// 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. + [UnscopedRef] 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.As(ref Unsafe.AsRef(in this.m11)), 1)); + [UnscopedRef] + public readonly ref bool M11 => ref this.m11; /// /// 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.As(ref Unsafe.AsRef(in this.m12)), 1)); + [UnscopedRef] + public readonly ref bool M12 => ref this.m12; /// /// 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.As(ref Unsafe.AsRef(in this.m21)), 1)); + [UnscopedRef] + public readonly ref bool M21 => ref this.m21; /// /// 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.As(ref Unsafe.AsRef(in this.m22)), 1)); + [UnscopedRef] + public readonly ref bool M22 => ref this.m22; /// /// 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.As(ref Unsafe.AsRef(in this.m31)), 1)); + [UnscopedRef] + public readonly ref bool M31 => ref this.m31; /// /// 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.As(ref Unsafe.AsRef(in this.m32)), 1)); + [UnscopedRef] + public readonly ref bool M32 => ref this.m32; /// /// Creates a new value with the same value for all its components. @@ -1616,12 +1695,12 @@ public unsafe partial struct Bool3x2 { Bool3x2 matrix; - matrix.m11 = x ? 1 : 0; - matrix.m12 = x ? 1 : 0; - matrix.m21 = x ? 1 : 0; - matrix.m22 = x ? 1 : 0; - matrix.m31 = x ? 1 : 0; - matrix.m32 = x ? 1 : 0; + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m31 = x; + matrix.m32 = x; return matrix; } @@ -1689,31 +1768,31 @@ public unsafe partial struct Bool3x3 private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool3x3), sizeof(Bool4)); [FieldOffset(0)] - private int m11; + private bool m11; [FieldOffset(4)] - private int m12; + private bool m12; [FieldOffset(8)] - private int m13; + private bool m13; [FieldOffset(12)] - private int m21; + private bool m21; [FieldOffset(16)] - private int m22; + private bool m22; [FieldOffset(20)] - private int m23; + private bool m23; [FieldOffset(24)] - private int m31; + private bool m31; [FieldOffset(28)] - private int m32; + private bool m32; [FieldOffset(32)] - private int m33; + private bool m33; /// /// Creates a new instance with the specified parameters. @@ -1729,15 +1808,15 @@ public unsafe partial struct Bool3x3 /// 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 ? 1 : 0; - this.m12 = m12 ? 1 : 0; - this.m13 = m13 ? 1 : 0; - this.m21 = m21 ? 1 : 0; - this.m22 = m22 ? 1 : 0; - this.m23 = m23 ? 1 : 0; - this.m31 = m31 ? 1 : 0; - this.m32 = m32 ? 1 : 0; - this.m33 = m33 ? 1 : 0; + 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; } /// @@ -1748,15 +1827,15 @@ public unsafe partial struct Bool3x3 /// The value to assign to the row at position [3]. public Bool3x3(Bool3 row1, Bool3 row2, Bool3 row3) { - this.m11 = row1.X ? 1 : 0; - this.m12 = row1.Y ? 1 : 0; - this.m13 = row1.Z ? 1 : 0; - this.m21 = row2.X ? 1 : 0; - this.m22 = row2.Y ? 1 : 0; - this.m23 = row2.Z ? 1 : 0; - this.m31 = row3.X ? 1 : 0; - this.m32 = row3.Y ? 1 : 0; - this.m33 = row3.Z ? 1 : 0; + 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; } /// @@ -1764,6 +1843,7 @@ public unsafe partial struct Bool3x3 /// /// 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. + [UnscopedRef] public readonly ref Bool3 this[int row] => ref *(Bool3*)UndefinedData; /// @@ -1772,6 +1852,7 @@ public unsafe partial struct Bool3x3 /// 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. + [UnscopedRef] public readonly ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; /// @@ -1781,6 +1862,7 @@ public unsafe partial struct Bool3x3 /// 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. + [UnscopedRef] public readonly ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; /// @@ -1791,52 +1873,62 @@ public unsafe partial struct Bool3x3 /// 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. + [UnscopedRef] 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.As(ref Unsafe.AsRef(in this.m11)), 1)); + [UnscopedRef] + public readonly ref bool M11 => ref this.m11; /// /// 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.As(ref Unsafe.AsRef(in this.m12)), 1)); + [UnscopedRef] + public readonly ref bool M12 => ref this.m12; /// /// 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.As(ref Unsafe.AsRef(in this.m13)), 1)); + [UnscopedRef] + public readonly ref bool M13 => ref this.m13; /// /// 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.As(ref Unsafe.AsRef(in this.m21)), 1)); + [UnscopedRef] + public readonly ref bool M21 => ref this.m21; /// /// 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.As(ref Unsafe.AsRef(in this.m22)), 1)); + [UnscopedRef] + public readonly ref bool M22 => ref this.m22; /// /// 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.As(ref Unsafe.AsRef(in this.m23)), 1)); + [UnscopedRef] + public readonly ref bool M23 => ref this.m23; /// /// 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.As(ref Unsafe.AsRef(in this.m31)), 1)); + [UnscopedRef] + public readonly ref bool M31 => ref this.m31; /// /// 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.As(ref Unsafe.AsRef(in this.m32)), 1)); + [UnscopedRef] + public readonly ref bool M32 => ref this.m32; /// /// 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.As(ref Unsafe.AsRef(in this.m33)), 1)); + [UnscopedRef] + public readonly ref bool M33 => ref this.m33; /// /// Creates a new value with the same value for all its components. @@ -1846,15 +1938,15 @@ public unsafe partial struct Bool3x3 { Bool3x3 matrix; - matrix.m11 = x ? 1 : 0; - matrix.m12 = x ? 1 : 0; - matrix.m13 = x ? 1 : 0; - matrix.m21 = x ? 1 : 0; - matrix.m22 = x ? 1 : 0; - matrix.m23 = x ? 1 : 0; - matrix.m31 = x ? 1 : 0; - matrix.m32 = x ? 1 : 0; - matrix.m33 = x ? 1 : 0; + 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; } @@ -1922,40 +2014,40 @@ public unsafe partial struct Bool3x4 private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool3x4), sizeof(Bool4)); [FieldOffset(0)] - private int m11; + private bool m11; [FieldOffset(4)] - private int m12; + private bool m12; [FieldOffset(8)] - private int m13; + private bool m13; [FieldOffset(12)] - private int m14; + private bool m14; [FieldOffset(16)] - private int m21; + private bool m21; [FieldOffset(20)] - private int m22; + private bool m22; [FieldOffset(24)] - private int m23; + private bool m23; [FieldOffset(28)] - private int m24; + private bool m24; [FieldOffset(32)] - private int m31; + private bool m31; [FieldOffset(36)] - private int m32; + private bool m32; [FieldOffset(40)] - private int m33; + private bool m33; [FieldOffset(44)] - private int m34; + private bool m34; /// /// Creates a new instance with the specified parameters. @@ -1974,18 +2066,18 @@ public unsafe partial struct Bool3x4 /// 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 ? 1 : 0; - this.m12 = m12 ? 1 : 0; - this.m13 = m13 ? 1 : 0; - this.m14 = m14 ? 1 : 0; - this.m21 = m21 ? 1 : 0; - this.m22 = m22 ? 1 : 0; - this.m23 = m23 ? 1 : 0; - this.m24 = m24 ? 1 : 0; - this.m31 = m31 ? 1 : 0; - this.m32 = m32 ? 1 : 0; - this.m33 = m33 ? 1 : 0; - this.m34 = m34 ? 1 : 0; + 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; } /// @@ -1996,18 +2088,18 @@ public unsafe partial struct Bool3x4 /// The value to assign to the row at position [3]. public Bool3x4(Bool4 row1, Bool4 row2, Bool4 row3) { - this.m11 = row1.X ? 1 : 0; - this.m12 = row1.Y ? 1 : 0; - this.m13 = row1.Z ? 1 : 0; - this.m14 = row1.W ? 1 : 0; - this.m21 = row2.X ? 1 : 0; - this.m22 = row2.Y ? 1 : 0; - this.m23 = row2.Z ? 1 : 0; - this.m24 = row2.W ? 1 : 0; - this.m31 = row3.X ? 1 : 0; - this.m32 = row3.Y ? 1 : 0; - this.m33 = row3.Z ? 1 : 0; - this.m34 = row3.W ? 1 : 0; + 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; } /// @@ -2015,6 +2107,7 @@ public unsafe partial struct Bool3x4 /// /// 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. + [UnscopedRef] public readonly ref Bool4 this[int row] => ref *(Bool4*)UndefinedData; /// @@ -2023,6 +2116,7 @@ public unsafe partial struct Bool3x4 /// 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. + [UnscopedRef] public readonly ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; /// @@ -2032,6 +2126,7 @@ public unsafe partial struct Bool3x4 /// 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. + [UnscopedRef] public readonly ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; /// @@ -2042,67 +2137,80 @@ public unsafe partial struct Bool3x4 /// 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. + [UnscopedRef] 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.As(ref Unsafe.AsRef(in this.m11)), 1)); + [UnscopedRef] + public readonly ref bool M11 => ref this.m11; /// /// 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.As(ref Unsafe.AsRef(in this.m12)), 1)); + [UnscopedRef] + public readonly ref bool M12 => ref this.m12; /// /// 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.As(ref Unsafe.AsRef(in this.m13)), 1)); + [UnscopedRef] + public readonly ref bool M13 => ref this.m13; /// /// 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.As(ref Unsafe.AsRef(in this.m14)), 1)); + [UnscopedRef] + public readonly ref bool M14 => ref this.m14; /// /// 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.As(ref Unsafe.AsRef(in this.m21)), 1)); + [UnscopedRef] + public readonly ref bool M21 => ref this.m21; /// /// 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.As(ref Unsafe.AsRef(in this.m22)), 1)); + [UnscopedRef] + public readonly ref bool M22 => ref this.m22; /// /// 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.As(ref Unsafe.AsRef(in this.m23)), 1)); + [UnscopedRef] + public readonly ref bool M23 => ref this.m23; /// /// 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.As(ref Unsafe.AsRef(in this.m24)), 1)); + [UnscopedRef] + public readonly ref bool M24 => ref this.m24; /// /// 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.As(ref Unsafe.AsRef(in this.m31)), 1)); + [UnscopedRef] + public readonly ref bool M31 => ref this.m31; /// /// 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.As(ref Unsafe.AsRef(in this.m32)), 1)); + [UnscopedRef] + public readonly ref bool M32 => ref this.m32; /// /// 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.As(ref Unsafe.AsRef(in this.m33)), 1)); + [UnscopedRef] + public readonly ref bool M33 => ref this.m33; /// /// 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.As(ref Unsafe.AsRef(in this.m34)), 1)); + [UnscopedRef] + public readonly ref bool M34 => ref this.m34; /// /// Creates a new value with the same value for all its components. @@ -2112,18 +2220,18 @@ public unsafe partial struct Bool3x4 { Bool3x4 matrix; - matrix.m11 = x ? 1 : 0; - matrix.m12 = x ? 1 : 0; - matrix.m13 = x ? 1 : 0; - matrix.m14 = x ? 1 : 0; - matrix.m21 = x ? 1 : 0; - matrix.m22 = x ? 1 : 0; - matrix.m23 = x ? 1 : 0; - matrix.m24 = x ? 1 : 0; - matrix.m31 = x ? 1 : 0; - matrix.m32 = x ? 1 : 0; - matrix.m33 = x ? 1 : 0; - matrix.m34 = x ? 1 : 0; + 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; } @@ -2191,16 +2299,16 @@ public unsafe partial struct Bool4x1 private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool4x1), sizeof(Bool4)); [FieldOffset(0)] - private int m11; + private bool m11; [FieldOffset(4)] - private int m21; + private bool m21; [FieldOffset(8)] - private int m31; + private bool m31; [FieldOffset(12)] - private int m41; + private bool m41; /// /// Creates a new instance with the specified parameters. @@ -2211,10 +2319,10 @@ public unsafe partial struct Bool4x1 /// The value to assign to the component at position [4, 1]. public Bool4x1(bool m11, bool m21, bool m31, bool m41) { - this.m11 = m11 ? 1 : 0; - this.m21 = m21 ? 1 : 0; - this.m31 = m31 ? 1 : 0; - this.m41 = m41 ? 1 : 0; + this.m11 = m11; + this.m21 = m21; + this.m31 = m31; + this.m41 = m41; } /// @@ -2222,6 +2330,7 @@ public unsafe partial struct Bool4x1 /// /// 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. + [UnscopedRef] public readonly ref bool this[int row] => ref *(bool*)UndefinedData; /// @@ -2230,6 +2339,7 @@ public unsafe partial struct Bool4x1 /// 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. + [UnscopedRef] public readonly ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; /// @@ -2239,6 +2349,7 @@ public unsafe partial struct Bool4x1 /// 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. + [UnscopedRef] public readonly ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; /// @@ -2249,27 +2360,32 @@ public unsafe partial struct Bool4x1 /// 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. + [UnscopedRef] 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.As(ref Unsafe.AsRef(in this.m11)), 1)); + [UnscopedRef] + public readonly ref bool M11 => ref this.m11; /// /// 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.As(ref Unsafe.AsRef(in this.m21)), 1)); + [UnscopedRef] + public readonly ref bool M21 => ref this.m21; /// /// 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.As(ref Unsafe.AsRef(in this.m31)), 1)); + [UnscopedRef] + public readonly ref bool M31 => ref this.m31; /// /// 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.As(ref Unsafe.AsRef(in this.m41)), 1)); + [UnscopedRef] + public readonly ref bool M41 => ref this.m41; /// /// Creates a new value with the same value for all its components. @@ -2279,10 +2395,10 @@ public unsafe partial struct Bool4x1 { Bool4x1 matrix; - matrix.m11 = x ? 1 : 0; - matrix.m21 = x ? 1 : 0; - matrix.m31 = x ? 1 : 0; - matrix.m41 = x ? 1 : 0; + matrix.m11 = x; + matrix.m21 = x; + matrix.m31 = x; + matrix.m41 = x; return matrix; } @@ -2356,28 +2472,28 @@ public unsafe partial struct Bool4x2 private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool4x2), sizeof(Bool4)); [FieldOffset(0)] - private int m11; + private bool m11; [FieldOffset(4)] - private int m12; + private bool m12; [FieldOffset(8)] - private int m21; + private bool m21; [FieldOffset(12)] - private int m22; + private bool m22; [FieldOffset(16)] - private int m31; + private bool m31; [FieldOffset(20)] - private int m32; + private bool m32; [FieldOffset(24)] - private int m41; + private bool m41; [FieldOffset(28)] - private int m42; + private bool m42; /// /// Creates a new instance with the specified parameters. @@ -2392,14 +2508,14 @@ public unsafe partial struct Bool4x2 /// 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 ? 1 : 0; - this.m12 = m12 ? 1 : 0; - this.m21 = m21 ? 1 : 0; - this.m22 = m22 ? 1 : 0; - this.m31 = m31 ? 1 : 0; - this.m32 = m32 ? 1 : 0; - this.m41 = m41 ? 1 : 0; - this.m42 = m42 ? 1 : 0; + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + this.m31 = m31; + this.m32 = m32; + this.m41 = m41; + this.m42 = m42; } /// @@ -2411,14 +2527,14 @@ public unsafe partial struct Bool4x2 /// The value to assign to the row at position [4]. public Bool4x2(Bool2 row1, Bool2 row2, Bool2 row3, Bool2 row4) { - this.m11 = row1.X ? 1 : 0; - this.m12 = row1.Y ? 1 : 0; - this.m21 = row2.X ? 1 : 0; - this.m22 = row2.Y ? 1 : 0; - this.m31 = row3.X ? 1 : 0; - this.m32 = row3.Y ? 1 : 0; - this.m41 = row4.X ? 1 : 0; - this.m42 = row4.Y ? 1 : 0; + 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; } /// @@ -2426,6 +2542,7 @@ public unsafe partial struct Bool4x2 /// /// 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. + [UnscopedRef] public readonly ref Bool2 this[int row] => ref *(Bool2*)UndefinedData; /// @@ -2434,6 +2551,7 @@ public unsafe partial struct Bool4x2 /// 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. + [UnscopedRef] public readonly ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; /// @@ -2443,6 +2561,7 @@ public unsafe partial struct Bool4x2 /// 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. + [UnscopedRef] public readonly ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; /// @@ -2453,47 +2572,56 @@ public unsafe partial struct Bool4x2 /// 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. + [UnscopedRef] 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.As(ref Unsafe.AsRef(in this.m11)), 1)); + [UnscopedRef] + public readonly ref bool M11 => ref this.m11; /// /// 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.As(ref Unsafe.AsRef(in this.m12)), 1)); + [UnscopedRef] + public readonly ref bool M12 => ref this.m12; /// /// 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.As(ref Unsafe.AsRef(in this.m21)), 1)); + [UnscopedRef] + public readonly ref bool M21 => ref this.m21; /// /// 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.As(ref Unsafe.AsRef(in this.m22)), 1)); + [UnscopedRef] + public readonly ref bool M22 => ref this.m22; /// /// 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.As(ref Unsafe.AsRef(in this.m31)), 1)); + [UnscopedRef] + public readonly ref bool M31 => ref this.m31; /// /// 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.As(ref Unsafe.AsRef(in this.m32)), 1)); + [UnscopedRef] + public readonly ref bool M32 => ref this.m32; /// /// 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.As(ref Unsafe.AsRef(in this.m41)), 1)); + [UnscopedRef] + public readonly ref bool M41 => ref this.m41; /// /// 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.As(ref Unsafe.AsRef(in this.m42)), 1)); + [UnscopedRef] + public readonly ref bool M42 => ref this.m42; /// /// Creates a new value with the same value for all its components. @@ -2503,14 +2631,14 @@ public unsafe partial struct Bool4x2 { Bool4x2 matrix; - matrix.m11 = x ? 1 : 0; - matrix.m12 = x ? 1 : 0; - matrix.m21 = x ? 1 : 0; - matrix.m22 = x ? 1 : 0; - matrix.m31 = x ? 1 : 0; - matrix.m32 = x ? 1 : 0; - matrix.m41 = x ? 1 : 0; - matrix.m42 = x ? 1 : 0; + 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; } @@ -2578,40 +2706,40 @@ public unsafe partial struct Bool4x3 private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool4x3), sizeof(Bool4)); [FieldOffset(0)] - private int m11; + private bool m11; [FieldOffset(4)] - private int m12; + private bool m12; [FieldOffset(8)] - private int m13; + private bool m13; [FieldOffset(12)] - private int m21; + private bool m21; [FieldOffset(16)] - private int m22; + private bool m22; [FieldOffset(20)] - private int m23; + private bool m23; [FieldOffset(24)] - private int m31; + private bool m31; [FieldOffset(28)] - private int m32; + private bool m32; [FieldOffset(32)] - private int m33; + private bool m33; [FieldOffset(36)] - private int m41; + private bool m41; [FieldOffset(40)] - private int m42; + private bool m42; [FieldOffset(44)] - private int m43; + private bool m43; /// /// Creates a new instance with the specified parameters. @@ -2630,18 +2758,18 @@ public unsafe partial struct Bool4x3 /// 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 ? 1 : 0; - this.m12 = m12 ? 1 : 0; - this.m13 = m13 ? 1 : 0; - this.m21 = m21 ? 1 : 0; - this.m22 = m22 ? 1 : 0; - this.m23 = m23 ? 1 : 0; - this.m31 = m31 ? 1 : 0; - this.m32 = m32 ? 1 : 0; - this.m33 = m33 ? 1 : 0; - this.m41 = m41 ? 1 : 0; - this.m42 = m42 ? 1 : 0; - this.m43 = m43 ? 1 : 0; + 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; } /// @@ -2653,18 +2781,18 @@ public unsafe partial struct Bool4x3 /// The value to assign to the row at position [4]. public Bool4x3(Bool3 row1, Bool3 row2, Bool3 row3, Bool3 row4) { - this.m11 = row1.X ? 1 : 0; - this.m12 = row1.Y ? 1 : 0; - this.m13 = row1.Z ? 1 : 0; - this.m21 = row2.X ? 1 : 0; - this.m22 = row2.Y ? 1 : 0; - this.m23 = row2.Z ? 1 : 0; - this.m31 = row3.X ? 1 : 0; - this.m32 = row3.Y ? 1 : 0; - this.m33 = row3.Z ? 1 : 0; - this.m41 = row4.X ? 1 : 0; - this.m42 = row4.Y ? 1 : 0; - this.m43 = row4.Z ? 1 : 0; + 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; } /// @@ -2672,6 +2800,7 @@ public unsafe partial struct Bool4x3 /// /// 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. + [UnscopedRef] public readonly ref Bool3 this[int row] => ref *(Bool3*)UndefinedData; /// @@ -2680,6 +2809,7 @@ public unsafe partial struct Bool4x3 /// 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. + [UnscopedRef] public readonly ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; /// @@ -2689,6 +2819,7 @@ public unsafe partial struct Bool4x3 /// 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. + [UnscopedRef] public readonly ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; /// @@ -2699,67 +2830,80 @@ public unsafe partial struct Bool4x3 /// 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. + [UnscopedRef] 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.As(ref Unsafe.AsRef(in this.m11)), 1)); + [UnscopedRef] + public readonly ref bool M11 => ref this.m11; /// /// 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.As(ref Unsafe.AsRef(in this.m12)), 1)); + [UnscopedRef] + public readonly ref bool M12 => ref this.m12; /// /// 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.As(ref Unsafe.AsRef(in this.m13)), 1)); + [UnscopedRef] + public readonly ref bool M13 => ref this.m13; /// /// 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.As(ref Unsafe.AsRef(in this.m21)), 1)); + [UnscopedRef] + public readonly ref bool M21 => ref this.m21; /// /// 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.As(ref Unsafe.AsRef(in this.m22)), 1)); + [UnscopedRef] + public readonly ref bool M22 => ref this.m22; /// /// 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.As(ref Unsafe.AsRef(in this.m23)), 1)); + [UnscopedRef] + public readonly ref bool M23 => ref this.m23; /// /// 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.As(ref Unsafe.AsRef(in this.m31)), 1)); + [UnscopedRef] + public readonly ref bool M31 => ref this.m31; /// /// 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.As(ref Unsafe.AsRef(in this.m32)), 1)); + [UnscopedRef] + public readonly ref bool M32 => ref this.m32; /// /// 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.As(ref Unsafe.AsRef(in this.m33)), 1)); + [UnscopedRef] + public readonly ref bool M33 => ref this.m33; /// /// 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.As(ref Unsafe.AsRef(in this.m41)), 1)); + [UnscopedRef] + public readonly ref bool M41 => ref this.m41; /// /// 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.As(ref Unsafe.AsRef(in this.m42)), 1)); + [UnscopedRef] + public readonly ref bool M42 => ref this.m42; /// /// 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.As(ref Unsafe.AsRef(in this.m43)), 1)); + [UnscopedRef] + public readonly ref bool M43 => ref this.m43; /// /// Creates a new value with the same value for all its components. @@ -2769,18 +2913,18 @@ public unsafe partial struct Bool4x3 { Bool4x3 matrix; - matrix.m11 = x ? 1 : 0; - matrix.m12 = x ? 1 : 0; - matrix.m13 = x ? 1 : 0; - matrix.m21 = x ? 1 : 0; - matrix.m22 = x ? 1 : 0; - matrix.m23 = x ? 1 : 0; - matrix.m31 = x ? 1 : 0; - matrix.m32 = x ? 1 : 0; - matrix.m33 = x ? 1 : 0; - matrix.m41 = x ? 1 : 0; - matrix.m42 = x ? 1 : 0; - matrix.m43 = x ? 1 : 0; + 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; } @@ -2848,52 +2992,52 @@ public unsafe partial struct Bool4x4 private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool4x4), sizeof(Bool4)); [FieldOffset(0)] - private int m11; + private bool m11; [FieldOffset(4)] - private int m12; + private bool m12; [FieldOffset(8)] - private int m13; + private bool m13; [FieldOffset(12)] - private int m14; + private bool m14; [FieldOffset(16)] - private int m21; + private bool m21; [FieldOffset(20)] - private int m22; + private bool m22; [FieldOffset(24)] - private int m23; + private bool m23; [FieldOffset(28)] - private int m24; + private bool m24; [FieldOffset(32)] - private int m31; + private bool m31; [FieldOffset(36)] - private int m32; + private bool m32; [FieldOffset(40)] - private int m33; + private bool m33; [FieldOffset(44)] - private int m34; + private bool m34; [FieldOffset(48)] - private int m41; + private bool m41; [FieldOffset(52)] - private int m42; + private bool m42; [FieldOffset(56)] - private int m43; + private bool m43; [FieldOffset(60)] - private int m44; + private bool m44; /// /// Creates a new instance with the specified parameters. @@ -2916,22 +3060,22 @@ public unsafe partial struct Bool4x4 /// 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 ? 1 : 0; - this.m12 = m12 ? 1 : 0; - this.m13 = m13 ? 1 : 0; - this.m14 = m14 ? 1 : 0; - this.m21 = m21 ? 1 : 0; - this.m22 = m22 ? 1 : 0; - this.m23 = m23 ? 1 : 0; - this.m24 = m24 ? 1 : 0; - this.m31 = m31 ? 1 : 0; - this.m32 = m32 ? 1 : 0; - this.m33 = m33 ? 1 : 0; - this.m34 = m34 ? 1 : 0; - this.m41 = m41 ? 1 : 0; - this.m42 = m42 ? 1 : 0; - this.m43 = m43 ? 1 : 0; - this.m44 = m44 ? 1 : 0; + 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; } /// @@ -2943,22 +3087,22 @@ public unsafe partial struct Bool4x4 /// The value to assign to the row at position [4]. public Bool4x4(Bool4 row1, Bool4 row2, Bool4 row3, Bool4 row4) { - this.m11 = row1.X ? 1 : 0; - this.m12 = row1.Y ? 1 : 0; - this.m13 = row1.Z ? 1 : 0; - this.m14 = row1.W ? 1 : 0; - this.m21 = row2.X ? 1 : 0; - this.m22 = row2.Y ? 1 : 0; - this.m23 = row2.Z ? 1 : 0; - this.m24 = row2.W ? 1 : 0; - this.m31 = row3.X ? 1 : 0; - this.m32 = row3.Y ? 1 : 0; - this.m33 = row3.Z ? 1 : 0; - this.m34 = row3.W ? 1 : 0; - this.m41 = row4.X ? 1 : 0; - this.m42 = row4.Y ? 1 : 0; - this.m43 = row4.Z ? 1 : 0; - this.m44 = row4.W ? 1 : 0; + 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; } /// @@ -2966,6 +3110,7 @@ public unsafe partial struct Bool4x4 /// /// 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. + [UnscopedRef] public readonly ref Bool4 this[int row] => ref *(Bool4*)UndefinedData; /// @@ -2974,6 +3119,7 @@ public unsafe partial struct Bool4x4 /// 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. + [UnscopedRef] public readonly ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Bool2*)UndefinedData; /// @@ -2983,6 +3129,7 @@ public unsafe partial struct Bool4x4 /// 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. + [UnscopedRef] public readonly ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Bool3*)UndefinedData; /// @@ -2993,87 +3140,104 @@ public unsafe partial struct Bool4x4 /// 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. + [UnscopedRef] 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.As(ref Unsafe.AsRef(in this.m11)), 1)); + [UnscopedRef] + public readonly ref bool M11 => ref this.m11; /// /// 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.As(ref Unsafe.AsRef(in this.m12)), 1)); + [UnscopedRef] + public readonly ref bool M12 => ref this.m12; /// /// 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.As(ref Unsafe.AsRef(in this.m13)), 1)); + [UnscopedRef] + public readonly ref bool M13 => ref this.m13; /// /// 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.As(ref Unsafe.AsRef(in this.m14)), 1)); + [UnscopedRef] + public readonly ref bool M14 => ref this.m14; /// /// 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.As(ref Unsafe.AsRef(in this.m21)), 1)); + [UnscopedRef] + public readonly ref bool M21 => ref this.m21; /// /// 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.As(ref Unsafe.AsRef(in this.m22)), 1)); + [UnscopedRef] + public readonly ref bool M22 => ref this.m22; /// /// 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.As(ref Unsafe.AsRef(in this.m23)), 1)); + [UnscopedRef] + public readonly ref bool M23 => ref this.m23; /// /// 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.As(ref Unsafe.AsRef(in this.m24)), 1)); + [UnscopedRef] + public readonly ref bool M24 => ref this.m24; /// /// 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.As(ref Unsafe.AsRef(in this.m31)), 1)); + [UnscopedRef] + public readonly ref bool M31 => ref this.m31; /// /// 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.As(ref Unsafe.AsRef(in this.m32)), 1)); + [UnscopedRef] + public readonly ref bool M32 => ref this.m32; /// /// 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.As(ref Unsafe.AsRef(in this.m33)), 1)); + [UnscopedRef] + public readonly ref bool M33 => ref this.m33; /// /// 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.As(ref Unsafe.AsRef(in this.m34)), 1)); + [UnscopedRef] + public readonly ref bool M34 => ref this.m34; /// /// 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.As(ref Unsafe.AsRef(in this.m41)), 1)); + [UnscopedRef] + public readonly ref bool M41 => ref this.m41; /// /// 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.As(ref Unsafe.AsRef(in this.m42)), 1)); + [UnscopedRef] + public readonly ref bool M42 => ref this.m42; /// /// 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.As(ref Unsafe.AsRef(in this.m43)), 1)); + [UnscopedRef] + public readonly ref bool M43 => ref this.m43; /// /// 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.As(ref Unsafe.AsRef(in this.m44)), 1)); + [UnscopedRef] + public readonly ref bool M44 => ref this.m44; /// /// Creates a new value with the same value for all its components. @@ -3083,22 +3247,22 @@ public unsafe partial struct Bool4x4 { Bool4x4 matrix; - matrix.m11 = x ? 1 : 0; - matrix.m12 = x ? 1 : 0; - matrix.m13 = x ? 1 : 0; - matrix.m14 = x ? 1 : 0; - matrix.m21 = x ? 1 : 0; - matrix.m22 = x ? 1 : 0; - matrix.m23 = x ? 1 : 0; - matrix.m24 = x ? 1 : 0; - matrix.m31 = x ? 1 : 0; - matrix.m32 = x ? 1 : 0; - matrix.m33 = x ? 1 : 0; - matrix.m34 = x ? 1 : 0; - matrix.m41 = x ? 1 : 0; - matrix.m42 = x ? 1 : 0; - matrix.m43 = x ? 1 : 0; - matrix.m44 = x ? 1 : 0; + 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; } diff --git a/src/ComputeSharp.Core/Primitives/Double/DoubleMxN.g.cs b/src/ComputeSharp.Core/Primitives/Double/DoubleMxN.g.cs index 5344d2de..4c689b5f 100644 --- a/src/ComputeSharp.Core/Primitives/Double/DoubleMxN.g.cs +++ b/src/ComputeSharp.Core/Primitives/Double/DoubleMxN.g.cs @@ -1,8 +1,8 @@ -using System.Runtime.CompilerServices; +using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif #pragma warning disable CS0660, CS0661 @@ -35,6 +35,7 @@ public unsafe partial struct Double1x1 /// /// 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. + [UnscopedRef] public readonly ref double this[int row] => ref *(double*)UndefinedData; /// @@ -43,6 +44,7 @@ public unsafe partial struct Double1x1 /// 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. + [UnscopedRef] public readonly ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; /// @@ -52,6 +54,7 @@ public unsafe partial struct Double1x1 /// 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. + [UnscopedRef] public readonly ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; /// @@ -62,12 +65,14 @@ public unsafe partial struct Double1x1 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref double M11 => ref this.m11; /// /// Creates a new value with the same value for all its components. @@ -220,6 +225,7 @@ public unsafe partial struct Double1x2 /// /// 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. + [UnscopedRef] public readonly ref Double2 this[int row] => ref *(Double2*)UndefinedData; /// @@ -228,6 +234,7 @@ public unsafe partial struct Double1x2 /// 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. + [UnscopedRef] public readonly ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; /// @@ -237,6 +244,7 @@ public unsafe partial struct Double1x2 /// 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. + [UnscopedRef] public readonly ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; /// @@ -247,17 +255,20 @@ public unsafe partial struct Double1x2 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref double M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref double M12 => ref this.m12; /// /// Creates a new value with the same value for all its components. @@ -422,6 +433,7 @@ public unsafe partial struct Double1x3 /// /// 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. + [UnscopedRef] public readonly ref Double3 this[int row] => ref *(Double3*)UndefinedData; /// @@ -430,6 +442,7 @@ public unsafe partial struct Double1x3 /// 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. + [UnscopedRef] public readonly ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; /// @@ -439,6 +452,7 @@ public unsafe partial struct Double1x3 /// 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. + [UnscopedRef] public readonly ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; /// @@ -449,22 +463,26 @@ public unsafe partial struct Double1x3 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref double M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref double M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref double M13 => ref this.m13; /// /// Creates a new value with the same value for all its components. @@ -635,6 +653,7 @@ public unsafe partial struct Double1x4 /// /// 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. + [UnscopedRef] public readonly ref Double4 this[int row] => ref *(Double4*)UndefinedData; /// @@ -643,6 +662,7 @@ public unsafe partial struct Double1x4 /// 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. + [UnscopedRef] public readonly ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; /// @@ -652,6 +672,7 @@ public unsafe partial struct Double1x4 /// 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. + [UnscopedRef] public readonly ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; /// @@ -662,27 +683,32 @@ public unsafe partial struct Double1x4 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref double M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref double M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref double M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref double M14 => ref this.m14; /// /// Creates a new value with the same value for all its components. @@ -844,6 +870,7 @@ public unsafe partial struct Double2x1 /// /// 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. + [UnscopedRef] public readonly ref double this[int row] => ref *(double*)UndefinedData; /// @@ -852,6 +879,7 @@ public unsafe partial struct Double2x1 /// 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. + [UnscopedRef] public readonly ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; /// @@ -861,6 +889,7 @@ public unsafe partial struct Double2x1 /// 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. + [UnscopedRef] public readonly ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; /// @@ -871,17 +900,20 @@ public unsafe partial struct Double2x1 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref double M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref double M21 => ref this.m21; /// /// Creates a new value with the same value for all its components. @@ -1064,6 +1096,7 @@ public unsafe partial struct Double2x2 /// /// 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. + [UnscopedRef] public readonly ref Double2 this[int row] => ref *(Double2*)UndefinedData; /// @@ -1072,6 +1105,7 @@ public unsafe partial struct Double2x2 /// 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. + [UnscopedRef] public readonly ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; /// @@ -1081,6 +1115,7 @@ public unsafe partial struct Double2x2 /// 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. + [UnscopedRef] public readonly ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; /// @@ -1091,27 +1126,32 @@ public unsafe partial struct Double2x2 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref double M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref double M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref double M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref double M22 => ref this.m22; /// /// Creates a new value with the same value for all its components. @@ -1302,6 +1342,7 @@ public unsafe partial struct Double2x3 /// /// 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. + [UnscopedRef] public readonly ref Double3 this[int row] => ref *(Double3*)UndefinedData; /// @@ -1310,6 +1351,7 @@ public unsafe partial struct Double2x3 /// 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. + [UnscopedRef] public readonly ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; /// @@ -1319,6 +1361,7 @@ public unsafe partial struct Double2x3 /// 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. + [UnscopedRef] public readonly ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; /// @@ -1329,37 +1372,44 @@ public unsafe partial struct Double2x3 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref double M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref double M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref double M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref double M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref double M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref double M23 => ref this.m23; /// /// Creates a new value with the same value for all its components. @@ -1564,6 +1614,7 @@ public unsafe partial struct Double2x4 /// /// 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. + [UnscopedRef] public readonly ref Double4 this[int row] => ref *(Double4*)UndefinedData; /// @@ -1572,6 +1623,7 @@ public unsafe partial struct Double2x4 /// 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. + [UnscopedRef] public readonly ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; /// @@ -1581,6 +1633,7 @@ public unsafe partial struct Double2x4 /// 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. + [UnscopedRef] public readonly ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; /// @@ -1591,47 +1644,56 @@ public unsafe partial struct Double2x4 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref double M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref double M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref double M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref double M14 => ref this.m14; /// /// 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)); + [UnscopedRef] + public readonly ref double M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref double M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref double M23 => ref this.m23; /// /// 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)); + [UnscopedRef] + public readonly ref double M24 => ref this.m24; /// /// Creates a new value with the same value for all its components. @@ -1796,6 +1858,7 @@ public unsafe partial struct Double3x1 /// /// 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. + [UnscopedRef] public readonly ref double this[int row] => ref *(double*)UndefinedData; /// @@ -1804,6 +1867,7 @@ public unsafe partial struct Double3x1 /// 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. + [UnscopedRef] public readonly ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; /// @@ -1813,6 +1877,7 @@ public unsafe partial struct Double3x1 /// 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. + [UnscopedRef] public readonly ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; /// @@ -1823,22 +1888,26 @@ public unsafe partial struct Double3x1 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref double M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref double M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref double M31 => ref this.m31; /// /// Creates a new value with the same value for all its components. @@ -2035,6 +2104,7 @@ public unsafe partial struct Double3x2 /// /// 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. + [UnscopedRef] public readonly ref Double2 this[int row] => ref *(Double2*)UndefinedData; /// @@ -2043,6 +2113,7 @@ public unsafe partial struct Double3x2 /// 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. + [UnscopedRef] public readonly ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; /// @@ -2052,6 +2123,7 @@ public unsafe partial struct Double3x2 /// 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. + [UnscopedRef] public readonly ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; /// @@ -2062,37 +2134,44 @@ public unsafe partial struct Double3x2 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref double M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref double M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref double M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref double M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref double M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref double M32 => ref this.m32; /// /// Creates a new value with the same value for all its components. @@ -2304,6 +2383,7 @@ public unsafe partial struct Double3x3 /// /// 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. + [UnscopedRef] public readonly ref Double3 this[int row] => ref *(Double3*)UndefinedData; /// @@ -2312,6 +2392,7 @@ public unsafe partial struct Double3x3 /// 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. + [UnscopedRef] public readonly ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; /// @@ -2321,6 +2402,7 @@ public unsafe partial struct Double3x3 /// 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. + [UnscopedRef] public readonly ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; /// @@ -2331,52 +2413,62 @@ public unsafe partial struct Double3x3 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref double M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref double M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref double M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref double M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref double M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref double M23 => ref this.m23; /// /// 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)); + [UnscopedRef] + public readonly ref double M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref double M32 => ref this.m32; /// /// 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)); + [UnscopedRef] + public readonly ref double M33 => ref this.m33; /// /// Creates a new value with the same value for all its components. @@ -2609,6 +2701,7 @@ public unsafe partial struct Double3x4 /// /// 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. + [UnscopedRef] public readonly ref Double4 this[int row] => ref *(Double4*)UndefinedData; /// @@ -2617,6 +2710,7 @@ public unsafe partial struct Double3x4 /// 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. + [UnscopedRef] public readonly ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; /// @@ -2626,6 +2720,7 @@ public unsafe partial struct Double3x4 /// 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. + [UnscopedRef] public readonly ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; /// @@ -2636,67 +2731,80 @@ public unsafe partial struct Double3x4 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref double M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref double M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref double M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref double M14 => ref this.m14; /// /// 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)); + [UnscopedRef] + public readonly ref double M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref double M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref double M23 => ref this.m23; /// /// 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)); + [UnscopedRef] + public readonly ref double M24 => ref this.m24; /// /// 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)); + [UnscopedRef] + public readonly ref double M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref double M32 => ref this.m32; /// /// 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)); + [UnscopedRef] + public readonly ref double M33 => ref this.m33; /// /// 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)); + [UnscopedRef] + public readonly ref double M34 => ref this.m34; /// /// Creates a new value with the same value for all its components. @@ -2870,6 +2978,7 @@ public unsafe partial struct Double4x1 /// /// 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. + [UnscopedRef] public readonly ref double this[int row] => ref *(double*)UndefinedData; /// @@ -2878,6 +2987,7 @@ public unsafe partial struct Double4x1 /// 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. + [UnscopedRef] public readonly ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; /// @@ -2887,6 +2997,7 @@ public unsafe partial struct Double4x1 /// 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. + [UnscopedRef] public readonly ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; /// @@ -2897,27 +3008,32 @@ public unsafe partial struct Double4x1 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref double M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref double M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref double M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref double M41 => ref this.m41; /// /// Creates a new value with the same value for all its components. @@ -3128,6 +3244,7 @@ public unsafe partial struct Double4x2 /// /// 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. + [UnscopedRef] public readonly ref Double2 this[int row] => ref *(Double2*)UndefinedData; /// @@ -3136,6 +3253,7 @@ public unsafe partial struct Double4x2 /// 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. + [UnscopedRef] public readonly ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; /// @@ -3145,6 +3263,7 @@ public unsafe partial struct Double4x2 /// 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. + [UnscopedRef] public readonly ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; /// @@ -3155,47 +3274,56 @@ public unsafe partial struct Double4x2 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref double M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref double M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref double M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref double M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref double M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref double M32 => ref this.m32; /// /// 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)); + [UnscopedRef] + public readonly ref double M41 => ref this.m41; /// /// 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)); + [UnscopedRef] + public readonly ref double M42 => ref this.m42; /// /// Creates a new value with the same value for all its components. @@ -3428,6 +3556,7 @@ public unsafe partial struct Double4x3 /// /// 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. + [UnscopedRef] public readonly ref Double3 this[int row] => ref *(Double3*)UndefinedData; /// @@ -3436,6 +3565,7 @@ public unsafe partial struct Double4x3 /// 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. + [UnscopedRef] public readonly ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; /// @@ -3445,6 +3575,7 @@ public unsafe partial struct Double4x3 /// 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. + [UnscopedRef] public readonly ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; /// @@ -3455,67 +3586,80 @@ public unsafe partial struct Double4x3 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref double M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref double M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref double M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref double M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref double M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref double M23 => ref this.m23; /// /// 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)); + [UnscopedRef] + public readonly ref double M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref double M32 => ref this.m32; /// /// 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)); + [UnscopedRef] + public readonly ref double M33 => ref this.m33; /// /// 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)); + [UnscopedRef] + public readonly ref double M41 => ref this.m41; /// /// 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)); + [UnscopedRef] + public readonly ref double M42 => ref this.m42; /// /// 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)); + [UnscopedRef] + public readonly ref double M43 => ref this.m43; /// /// Creates a new value with the same value for all its components. @@ -3776,6 +3920,7 @@ public unsafe partial struct Double4x4 /// /// 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. + [UnscopedRef] public readonly ref Double4 this[int row] => ref *(Double4*)UndefinedData; /// @@ -3784,6 +3929,7 @@ public unsafe partial struct Double4x4 /// 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. + [UnscopedRef] public readonly ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Double2*)UndefinedData; /// @@ -3793,6 +3939,7 @@ public unsafe partial struct Double4x4 /// 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. + [UnscopedRef] public readonly ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Double3*)UndefinedData; /// @@ -3803,87 +3950,104 @@ public unsafe partial struct Double4x4 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref double M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref double M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref double M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref double M14 => ref this.m14; /// /// 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)); + [UnscopedRef] + public readonly ref double M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref double M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref double M23 => ref this.m23; /// /// 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)); + [UnscopedRef] + public readonly ref double M24 => ref this.m24; /// /// 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)); + [UnscopedRef] + public readonly ref double M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref double M32 => ref this.m32; /// /// 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)); + [UnscopedRef] + public readonly ref double M33 => ref this.m33; /// /// 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)); + [UnscopedRef] + public readonly ref double M34 => ref this.m34; /// /// 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)); + [UnscopedRef] + public readonly ref double M41 => ref this.m41; /// /// 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)); + [UnscopedRef] + public readonly ref double M42 => ref this.m42; /// /// 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)); + [UnscopedRef] + public readonly ref double M43 => ref this.m43; /// /// 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)); + [UnscopedRef] + public readonly ref double M44 => ref this.m44; /// /// Creates a new value with the same value for all its components. diff --git a/src/ComputeSharp.Core/Primitives/Float/FloatMxN.g.cs b/src/ComputeSharp.Core/Primitives/Float/FloatMxN.g.cs index 026093b4..f87304f7 100644 --- a/src/ComputeSharp.Core/Primitives/Float/FloatMxN.g.cs +++ b/src/ComputeSharp.Core/Primitives/Float/FloatMxN.g.cs @@ -1,9 +1,9 @@ -using System.Runtime.CompilerServices; +using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using ComputeSharp.Core.Intrinsics.Attributes; #if !NET6_0_OR_GREATER using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif #pragma warning disable CS0660, CS0661 @@ -36,6 +36,7 @@ public unsafe partial struct Float1x1 /// /// 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. + [UnscopedRef] public readonly ref float this[int row] => ref *(float*)UndefinedData; /// @@ -44,6 +45,7 @@ public unsafe partial struct Float1x1 /// 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. + [UnscopedRef] public readonly ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; /// @@ -53,6 +55,7 @@ public unsafe partial struct Float1x1 /// 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. + [UnscopedRef] public readonly ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; /// @@ -63,12 +66,14 @@ public unsafe partial struct Float1x1 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref float M11 => ref this.m11; /// /// Creates a new value with the same value for all its components. @@ -239,6 +244,7 @@ public unsafe partial struct Float1x2 /// /// 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. + [UnscopedRef] public readonly ref Float2 this[int row] => ref *(Float2*)UndefinedData; /// @@ -247,6 +253,7 @@ public unsafe partial struct Float1x2 /// 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. + [UnscopedRef] public readonly ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; /// @@ -256,6 +263,7 @@ public unsafe partial struct Float1x2 /// 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. + [UnscopedRef] public readonly ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; /// @@ -266,17 +274,20 @@ public unsafe partial struct Float1x2 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref float M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref float M12 => ref this.m12; /// /// Creates a new value with the same value for all its components. @@ -543,6 +554,7 @@ public unsafe partial struct Float1x3 /// /// 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. + [UnscopedRef] public readonly ref Float3 this[int row] => ref *(Float3*)UndefinedData; /// @@ -551,6 +563,7 @@ public unsafe partial struct Float1x3 /// 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. + [UnscopedRef] public readonly ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; /// @@ -560,6 +573,7 @@ public unsafe partial struct Float1x3 /// 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. + [UnscopedRef] public readonly ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; /// @@ -570,22 +584,26 @@ public unsafe partial struct Float1x3 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref float M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref float M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref float M13 => ref this.m13; /// /// Creates a new value with the same value for all its components. @@ -858,6 +876,7 @@ public unsafe partial struct Float1x4 /// /// 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. + [UnscopedRef] public readonly ref Float4 this[int row] => ref *(Float4*)UndefinedData; /// @@ -866,6 +885,7 @@ public unsafe partial struct Float1x4 /// 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. + [UnscopedRef] public readonly ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; /// @@ -875,6 +895,7 @@ public unsafe partial struct Float1x4 /// 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. + [UnscopedRef] public readonly ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; /// @@ -885,27 +906,32 @@ public unsafe partial struct Float1x4 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref float M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref float M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref float M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref float M14 => ref this.m14; /// /// Creates a new value with the same value for all its components. @@ -1169,6 +1195,7 @@ public unsafe partial struct Float2x1 /// /// 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. + [UnscopedRef] public readonly ref float this[int row] => ref *(float*)UndefinedData; /// @@ -1177,6 +1204,7 @@ public unsafe partial struct Float2x1 /// 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. + [UnscopedRef] public readonly ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; /// @@ -1186,6 +1214,7 @@ public unsafe partial struct Float2x1 /// 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. + [UnscopedRef] public readonly ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; /// @@ -1196,17 +1225,20 @@ public unsafe partial struct Float2x1 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref float M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref float M21 => ref this.m21; /// /// Creates a new value with the same value for all its components. @@ -1477,6 +1509,7 @@ public unsafe partial struct Float2x2 /// /// 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. + [UnscopedRef] public readonly ref Float2 this[int row] => ref *(Float2*)UndefinedData; /// @@ -1485,6 +1518,7 @@ public unsafe partial struct Float2x2 /// 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. + [UnscopedRef] public readonly ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; /// @@ -1494,6 +1528,7 @@ public unsafe partial struct Float2x2 /// 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. + [UnscopedRef] public readonly ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; /// @@ -1504,27 +1539,32 @@ public unsafe partial struct Float2x2 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref float M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref float M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref float M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref float M22 => ref this.m22; /// /// Creates a new value with the same value for all its components. @@ -1733,6 +1773,7 @@ public unsafe partial struct Float2x3 /// /// 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. + [UnscopedRef] public readonly ref Float3 this[int row] => ref *(Float3*)UndefinedData; /// @@ -1741,6 +1782,7 @@ public unsafe partial struct Float2x3 /// 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. + [UnscopedRef] public readonly ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; /// @@ -1750,6 +1792,7 @@ public unsafe partial struct Float2x3 /// 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. + [UnscopedRef] public readonly ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; /// @@ -1760,37 +1803,44 @@ public unsafe partial struct Float2x3 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref float M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref float M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref float M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref float M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref float M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref float M23 => ref this.m23; /// /// Creates a new value with the same value for all its components. @@ -2097,6 +2147,7 @@ public unsafe partial struct Float2x4 /// /// 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. + [UnscopedRef] public readonly ref Float4 this[int row] => ref *(Float4*)UndefinedData; /// @@ -2105,6 +2156,7 @@ public unsafe partial struct Float2x4 /// 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. + [UnscopedRef] public readonly ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; /// @@ -2114,6 +2166,7 @@ public unsafe partial struct Float2x4 /// 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. + [UnscopedRef] public readonly ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; /// @@ -2124,47 +2177,56 @@ public unsafe partial struct Float2x4 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref float M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref float M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref float M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref float M14 => ref this.m14; /// /// 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)); + [UnscopedRef] + public readonly ref float M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref float M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref float M23 => ref this.m23; /// /// 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)); + [UnscopedRef] + public readonly ref float M24 => ref this.m24; /// /// Creates a new value with the same value for all its components. @@ -2431,6 +2493,7 @@ public unsafe partial struct Float3x1 /// /// 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. + [UnscopedRef] public readonly ref float this[int row] => ref *(float*)UndefinedData; /// @@ -2439,6 +2502,7 @@ public unsafe partial struct Float3x1 /// 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. + [UnscopedRef] public readonly ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; /// @@ -2448,6 +2512,7 @@ public unsafe partial struct Float3x1 /// 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. + [UnscopedRef] public readonly ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; /// @@ -2458,22 +2523,26 @@ public unsafe partial struct Float3x1 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref float M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref float M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref float M31 => ref this.m31; /// /// Creates a new value with the same value for all its components. @@ -2758,6 +2827,7 @@ public unsafe partial struct Float3x2 /// /// 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. + [UnscopedRef] public readonly ref Float2 this[int row] => ref *(Float2*)UndefinedData; /// @@ -2766,6 +2836,7 @@ public unsafe partial struct Float3x2 /// 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. + [UnscopedRef] public readonly ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; /// @@ -2775,6 +2846,7 @@ public unsafe partial struct Float3x2 /// 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. + [UnscopedRef] public readonly ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; /// @@ -2785,37 +2857,44 @@ public unsafe partial struct Float3x2 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref float M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref float M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref float M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref float M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref float M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref float M32 => ref this.m32; /// /// Creates a new value with the same value for all its components. @@ -3129,6 +3208,7 @@ public unsafe partial struct Float3x3 /// /// 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. + [UnscopedRef] public readonly ref Float3 this[int row] => ref *(Float3*)UndefinedData; /// @@ -3137,6 +3217,7 @@ public unsafe partial struct Float3x3 /// 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. + [UnscopedRef] public readonly ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; /// @@ -3146,6 +3227,7 @@ public unsafe partial struct Float3x3 /// 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. + [UnscopedRef] public readonly ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; /// @@ -3156,52 +3238,62 @@ public unsafe partial struct Float3x3 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref float M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref float M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref float M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref float M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref float M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref float M23 => ref this.m23; /// /// 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)); + [UnscopedRef] + public readonly ref float M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref float M32 => ref this.m32; /// /// 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)); + [UnscopedRef] + public readonly ref float M33 => ref this.m33; /// /// Creates a new value with the same value for all its components. @@ -3452,6 +3544,7 @@ public unsafe partial struct Float3x4 /// /// 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. + [UnscopedRef] public readonly ref Float4 this[int row] => ref *(Float4*)UndefinedData; /// @@ -3460,6 +3553,7 @@ public unsafe partial struct Float3x4 /// 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. + [UnscopedRef] public readonly ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; /// @@ -3469,6 +3563,7 @@ public unsafe partial struct Float3x4 /// 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. + [UnscopedRef] public readonly ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; /// @@ -3479,67 +3574,80 @@ public unsafe partial struct Float3x4 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref float M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref float M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref float M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref float M14 => ref this.m14; /// /// 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)); + [UnscopedRef] + public readonly ref float M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref float M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref float M23 => ref this.m23; /// /// 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)); + [UnscopedRef] + public readonly ref float M24 => ref this.m24; /// /// 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)); + [UnscopedRef] + public readonly ref float M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref float M32 => ref this.m32; /// /// 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)); + [UnscopedRef] + public readonly ref float M33 => ref this.m33; /// /// 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)); + [UnscopedRef] + public readonly ref float M34 => ref this.m34; /// /// Creates a new value with the same value for all its components. @@ -3815,6 +3923,7 @@ public unsafe partial struct Float4x1 /// /// 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. + [UnscopedRef] public readonly ref float this[int row] => ref *(float*)UndefinedData; /// @@ -3823,6 +3932,7 @@ public unsafe partial struct Float4x1 /// 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. + [UnscopedRef] public readonly ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; /// @@ -3832,6 +3942,7 @@ public unsafe partial struct Float4x1 /// 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. + [UnscopedRef] public readonly ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; /// @@ -3842,27 +3953,32 @@ public unsafe partial struct Float4x1 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref float M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref float M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref float M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref float M41 => ref this.m41; /// /// Creates a new value with the same value for all its components. @@ -4161,6 +4277,7 @@ public unsafe partial struct Float4x2 /// /// 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. + [UnscopedRef] public readonly ref Float2 this[int row] => ref *(Float2*)UndefinedData; /// @@ -4169,6 +4286,7 @@ public unsafe partial struct Float4x2 /// 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. + [UnscopedRef] public readonly ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; /// @@ -4178,6 +4296,7 @@ public unsafe partial struct Float4x2 /// 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. + [UnscopedRef] public readonly ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; /// @@ -4188,47 +4307,56 @@ public unsafe partial struct Float4x2 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref float M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref float M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref float M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref float M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref float M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref float M32 => ref this.m32; /// /// 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)); + [UnscopedRef] + public readonly ref float M41 => ref this.m41; /// /// 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)); + [UnscopedRef] + public readonly ref float M42 => ref this.m42; /// /// Creates a new value with the same value for all its components. @@ -4563,6 +4691,7 @@ public unsafe partial struct Float4x3 /// /// 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. + [UnscopedRef] public readonly ref Float3 this[int row] => ref *(Float3*)UndefinedData; /// @@ -4571,6 +4700,7 @@ public unsafe partial struct Float4x3 /// 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. + [UnscopedRef] public readonly ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; /// @@ -4580,6 +4710,7 @@ public unsafe partial struct Float4x3 /// 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. + [UnscopedRef] public readonly ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; /// @@ -4590,67 +4721,80 @@ public unsafe partial struct Float4x3 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref float M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref float M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref float M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref float M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref float M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref float M23 => ref this.m23; /// /// 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)); + [UnscopedRef] + public readonly ref float M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref float M32 => ref this.m32; /// /// 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)); + [UnscopedRef] + public readonly ref float M33 => ref this.m33; /// /// 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)); + [UnscopedRef] + public readonly ref float M41 => ref this.m41; /// /// 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)); + [UnscopedRef] + public readonly ref float M42 => ref this.m42; /// /// 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)); + [UnscopedRef] + public readonly ref float M43 => ref this.m43; /// /// Creates a new value with the same value for all its components. @@ -5013,6 +5157,7 @@ public unsafe partial struct Float4x4 /// /// 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. + [UnscopedRef] public readonly ref Float4 this[int row] => ref *(Float4*)UndefinedData; /// @@ -5021,6 +5166,7 @@ public unsafe partial struct Float4x4 /// 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. + [UnscopedRef] public readonly ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Float2*)UndefinedData; /// @@ -5030,6 +5176,7 @@ public unsafe partial struct Float4x4 /// 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. + [UnscopedRef] public readonly ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Float3*)UndefinedData; /// @@ -5040,87 +5187,104 @@ public unsafe partial struct Float4x4 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref float M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref float M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref float M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref float M14 => ref this.m14; /// /// 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)); + [UnscopedRef] + public readonly ref float M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref float M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref float M23 => ref this.m23; /// /// 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)); + [UnscopedRef] + public readonly ref float M24 => ref this.m24; /// /// 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)); + [UnscopedRef] + public readonly ref float M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref float M32 => ref this.m32; /// /// 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)); + [UnscopedRef] + public readonly ref float M33 => ref this.m33; /// /// 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)); + [UnscopedRef] + public readonly ref float M34 => ref this.m34; /// /// 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)); + [UnscopedRef] + public readonly ref float M41 => ref this.m41; /// /// 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)); + [UnscopedRef] + public readonly ref float M42 => ref this.m42; /// /// 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)); + [UnscopedRef] + public readonly ref float M43 => ref this.m43; /// /// 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)); + [UnscopedRef] + public readonly ref float M44 => ref this.m44; /// /// Creates a new value with the same value for all its components. diff --git a/src/ComputeSharp.Core/Primitives/Int/IntMxN.g.cs b/src/ComputeSharp.Core/Primitives/Int/IntMxN.g.cs index 03b54736..50b5c630 100644 --- a/src/ComputeSharp.Core/Primitives/Int/IntMxN.g.cs +++ b/src/ComputeSharp.Core/Primitives/Int/IntMxN.g.cs @@ -1,9 +1,9 @@ -using System.Runtime.CompilerServices; +using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using ComputeSharp.Core.Intrinsics.Attributes; #if !NET6_0_OR_GREATER using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif #pragma warning disable CS0660, CS0661 @@ -36,6 +36,7 @@ public unsafe partial struct Int1x1 /// /// 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. + [UnscopedRef] public readonly ref int this[int row] => ref *(int*)UndefinedData; /// @@ -44,6 +45,7 @@ public unsafe partial struct Int1x1 /// 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. + [UnscopedRef] public readonly ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; /// @@ -53,6 +55,7 @@ public unsafe partial struct Int1x1 /// 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. + [UnscopedRef] public readonly ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; /// @@ -63,12 +66,14 @@ public unsafe partial struct Int1x1 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref int M11 => ref this.m11; /// /// Creates a new value with the same value for all its components. @@ -339,6 +344,7 @@ public unsafe partial struct Int1x2 /// /// 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. + [UnscopedRef] public readonly ref Int2 this[int row] => ref *(Int2*)UndefinedData; /// @@ -347,6 +353,7 @@ public unsafe partial struct Int1x2 /// 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. + [UnscopedRef] public readonly ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; /// @@ -356,6 +363,7 @@ public unsafe partial struct Int1x2 /// 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. + [UnscopedRef] public readonly ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; /// @@ -366,17 +374,20 @@ public unsafe partial struct Int1x2 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref int M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref int M12 => ref this.m12; /// /// Creates a new value with the same value for all its components. @@ -743,6 +754,7 @@ public unsafe partial struct Int1x3 /// /// 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. + [UnscopedRef] public readonly ref Int3 this[int row] => ref *(Int3*)UndefinedData; /// @@ -751,6 +763,7 @@ public unsafe partial struct Int1x3 /// 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. + [UnscopedRef] public readonly ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; /// @@ -760,6 +773,7 @@ public unsafe partial struct Int1x3 /// 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. + [UnscopedRef] public readonly ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; /// @@ -770,22 +784,26 @@ public unsafe partial struct Int1x3 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref int M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref int M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref int M13 => ref this.m13; /// /// Creates a new value with the same value for all its components. @@ -1158,6 +1176,7 @@ public unsafe partial struct Int1x4 /// /// 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. + [UnscopedRef] public readonly ref Int4 this[int row] => ref *(Int4*)UndefinedData; /// @@ -1166,6 +1185,7 @@ public unsafe partial struct Int1x4 /// 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. + [UnscopedRef] public readonly ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; /// @@ -1175,6 +1195,7 @@ public unsafe partial struct Int1x4 /// 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. + [UnscopedRef] public readonly ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; /// @@ -1185,27 +1206,32 @@ public unsafe partial struct Int1x4 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref int M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref int M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref int M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref int M14 => ref this.m14; /// /// Creates a new value with the same value for all its components. @@ -1569,6 +1595,7 @@ public unsafe partial struct Int2x1 /// /// 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. + [UnscopedRef] public readonly ref int this[int row] => ref *(int*)UndefinedData; /// @@ -1577,6 +1604,7 @@ public unsafe partial struct Int2x1 /// 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. + [UnscopedRef] public readonly ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; /// @@ -1586,6 +1614,7 @@ public unsafe partial struct Int2x1 /// 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. + [UnscopedRef] public readonly ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; /// @@ -1596,17 +1625,20 @@ public unsafe partial struct Int2x1 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref int M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref int M21 => ref this.m21; /// /// Creates a new value with the same value for all its components. @@ -1977,6 +2009,7 @@ public unsafe partial struct Int2x2 /// /// 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. + [UnscopedRef] public readonly ref Int2 this[int row] => ref *(Int2*)UndefinedData; /// @@ -1985,6 +2018,7 @@ public unsafe partial struct Int2x2 /// 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. + [UnscopedRef] public readonly ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; /// @@ -1994,6 +2028,7 @@ public unsafe partial struct Int2x2 /// 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. + [UnscopedRef] public readonly ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; /// @@ -2004,27 +2039,32 @@ public unsafe partial struct Int2x2 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref int M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref int M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref int M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref int M22 => ref this.m22; /// /// Creates a new value with the same value for all its components. @@ -2333,6 +2373,7 @@ public unsafe partial struct Int2x3 /// /// 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. + [UnscopedRef] public readonly ref Int3 this[int row] => ref *(Int3*)UndefinedData; /// @@ -2341,6 +2382,7 @@ public unsafe partial struct Int2x3 /// 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. + [UnscopedRef] public readonly ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; /// @@ -2350,6 +2392,7 @@ public unsafe partial struct Int2x3 /// 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. + [UnscopedRef] public readonly ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; /// @@ -2360,37 +2403,44 @@ public unsafe partial struct Int2x3 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref int M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref int M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref int M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref int M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref int M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref int M23 => ref this.m23; /// /// Creates a new value with the same value for all its components. @@ -2797,6 +2847,7 @@ public unsafe partial struct Int2x4 /// /// 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. + [UnscopedRef] public readonly ref Int4 this[int row] => ref *(Int4*)UndefinedData; /// @@ -2805,6 +2856,7 @@ public unsafe partial struct Int2x4 /// 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. + [UnscopedRef] public readonly ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; /// @@ -2814,6 +2866,7 @@ public unsafe partial struct Int2x4 /// 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. + [UnscopedRef] public readonly ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; /// @@ -2824,47 +2877,56 @@ public unsafe partial struct Int2x4 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref int M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref int M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref int M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref int M14 => ref this.m14; /// /// 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)); + [UnscopedRef] + public readonly ref int M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref int M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref int M23 => ref this.m23; /// /// 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)); + [UnscopedRef] + public readonly ref int M24 => ref this.m24; /// /// Creates a new value with the same value for all its components. @@ -3231,6 +3293,7 @@ public unsafe partial struct Int3x1 /// /// 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. + [UnscopedRef] public readonly ref int this[int row] => ref *(int*)UndefinedData; /// @@ -3239,6 +3302,7 @@ public unsafe partial struct Int3x1 /// 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. + [UnscopedRef] public readonly ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; /// @@ -3248,6 +3312,7 @@ public unsafe partial struct Int3x1 /// 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. + [UnscopedRef] public readonly ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; /// @@ -3258,22 +3323,26 @@ public unsafe partial struct Int3x1 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref int M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref int M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref int M31 => ref this.m31; /// /// Creates a new value with the same value for all its components. @@ -3658,6 +3727,7 @@ public unsafe partial struct Int3x2 /// /// 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. + [UnscopedRef] public readonly ref Int2 this[int row] => ref *(Int2*)UndefinedData; /// @@ -3666,6 +3736,7 @@ public unsafe partial struct Int3x2 /// 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. + [UnscopedRef] public readonly ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; /// @@ -3675,6 +3746,7 @@ public unsafe partial struct Int3x2 /// 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. + [UnscopedRef] public readonly ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; /// @@ -3685,37 +3757,44 @@ public unsafe partial struct Int3x2 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref int M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref int M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref int M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref int M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref int M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref int M32 => ref this.m32; /// /// Creates a new value with the same value for all its components. @@ -4129,6 +4208,7 @@ public unsafe partial struct Int3x3 /// /// 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. + [UnscopedRef] public readonly ref Int3 this[int row] => ref *(Int3*)UndefinedData; /// @@ -4137,6 +4217,7 @@ public unsafe partial struct Int3x3 /// 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. + [UnscopedRef] public readonly ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; /// @@ -4146,6 +4227,7 @@ public unsafe partial struct Int3x3 /// 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. + [UnscopedRef] public readonly ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; /// @@ -4156,52 +4238,62 @@ public unsafe partial struct Int3x3 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref int M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref int M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref int M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref int M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref int M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref int M23 => ref this.m23; /// /// 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)); + [UnscopedRef] + public readonly ref int M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref int M32 => ref this.m32; /// /// 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)); + [UnscopedRef] + public readonly ref int M33 => ref this.m33; /// /// Creates a new value with the same value for all its components. @@ -4552,6 +4644,7 @@ public unsafe partial struct Int3x4 /// /// 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. + [UnscopedRef] public readonly ref Int4 this[int row] => ref *(Int4*)UndefinedData; /// @@ -4560,6 +4653,7 @@ public unsafe partial struct Int3x4 /// 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. + [UnscopedRef] public readonly ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; /// @@ -4569,6 +4663,7 @@ public unsafe partial struct Int3x4 /// 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. + [UnscopedRef] public readonly ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; /// @@ -4579,67 +4674,80 @@ public unsafe partial struct Int3x4 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref int M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref int M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref int M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref int M14 => ref this.m14; /// /// 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)); + [UnscopedRef] + public readonly ref int M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref int M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref int M23 => ref this.m23; /// /// 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)); + [UnscopedRef] + public readonly ref int M24 => ref this.m24; /// /// 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)); + [UnscopedRef] + public readonly ref int M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref int M32 => ref this.m32; /// /// 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)); + [UnscopedRef] + public readonly ref int M33 => ref this.m33; /// /// 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)); + [UnscopedRef] + public readonly ref int M34 => ref this.m34; /// /// Creates a new value with the same value for all its components. @@ -5015,6 +5123,7 @@ public unsafe partial struct Int4x1 /// /// 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. + [UnscopedRef] public readonly ref int this[int row] => ref *(int*)UndefinedData; /// @@ -5023,6 +5132,7 @@ public unsafe partial struct Int4x1 /// 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. + [UnscopedRef] public readonly ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; /// @@ -5032,6 +5142,7 @@ public unsafe partial struct Int4x1 /// 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. + [UnscopedRef] public readonly ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; /// @@ -5042,27 +5153,32 @@ public unsafe partial struct Int4x1 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref int M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref int M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref int M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref int M41 => ref this.m41; /// /// Creates a new value with the same value for all its components. @@ -5461,6 +5577,7 @@ public unsafe partial struct Int4x2 /// /// 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. + [UnscopedRef] public readonly ref Int2 this[int row] => ref *(Int2*)UndefinedData; /// @@ -5469,6 +5586,7 @@ public unsafe partial struct Int4x2 /// 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. + [UnscopedRef] public readonly ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; /// @@ -5478,6 +5596,7 @@ public unsafe partial struct Int4x2 /// 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. + [UnscopedRef] public readonly ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; /// @@ -5488,47 +5607,56 @@ public unsafe partial struct Int4x2 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref int M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref int M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref int M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref int M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref int M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref int M32 => ref this.m32; /// /// 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)); + [UnscopedRef] + public readonly ref int M41 => ref this.m41; /// /// 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)); + [UnscopedRef] + public readonly ref int M42 => ref this.m42; /// /// Creates a new value with the same value for all its components. @@ -5963,6 +6091,7 @@ public unsafe partial struct Int4x3 /// /// 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. + [UnscopedRef] public readonly ref Int3 this[int row] => ref *(Int3*)UndefinedData; /// @@ -5971,6 +6100,7 @@ public unsafe partial struct Int4x3 /// 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. + [UnscopedRef] public readonly ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; /// @@ -5980,6 +6110,7 @@ public unsafe partial struct Int4x3 /// 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. + [UnscopedRef] public readonly ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; /// @@ -5990,67 +6121,80 @@ public unsafe partial struct Int4x3 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref int M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref int M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref int M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref int M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref int M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref int M23 => ref this.m23; /// /// 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)); + [UnscopedRef] + public readonly ref int M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref int M32 => ref this.m32; /// /// 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)); + [UnscopedRef] + public readonly ref int M33 => ref this.m33; /// /// 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)); + [UnscopedRef] + public readonly ref int M41 => ref this.m41; /// /// 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)); + [UnscopedRef] + public readonly ref int M42 => ref this.m42; /// /// 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)); + [UnscopedRef] + public readonly ref int M43 => ref this.m43; /// /// Creates a new value with the same value for all its components. @@ -6513,6 +6657,7 @@ public unsafe partial struct Int4x4 /// /// 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. + [UnscopedRef] public readonly ref Int4 this[int row] => ref *(Int4*)UndefinedData; /// @@ -6521,6 +6666,7 @@ public unsafe partial struct Int4x4 /// 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. + [UnscopedRef] public readonly ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(Int2*)UndefinedData; /// @@ -6530,6 +6676,7 @@ public unsafe partial struct Int4x4 /// 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. + [UnscopedRef] public readonly ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(Int3*)UndefinedData; /// @@ -6540,87 +6687,104 @@ public unsafe partial struct Int4x4 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref int M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref int M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref int M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref int M14 => ref this.m14; /// /// 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)); + [UnscopedRef] + public readonly ref int M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref int M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref int M23 => ref this.m23; /// /// 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)); + [UnscopedRef] + public readonly ref int M24 => ref this.m24; /// /// 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)); + [UnscopedRef] + public readonly ref int M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref int M32 => ref this.m32; /// /// 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)); + [UnscopedRef] + public readonly ref int M33 => ref this.m33; /// /// 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)); + [UnscopedRef] + public readonly ref int M34 => ref this.m34; /// /// 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)); + [UnscopedRef] + public readonly ref int M41 => ref this.m41; /// /// 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)); + [UnscopedRef] + public readonly ref int M42 => ref this.m42; /// /// 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)); + [UnscopedRef] + public readonly ref int M43 => ref this.m43; /// /// 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)); + [UnscopedRef] + public readonly ref int M44 => ref this.m44; /// /// Creates a new value with the same value for all its components. diff --git a/src/ComputeSharp.Core/Primitives/MatrixType.ttinclude b/src/ComputeSharp.Core/Primitives/MatrixType.ttinclude index a4134dcd..514127f9 100644 --- a/src/ComputeSharp.Core/Primitives/MatrixType.ttinclude +++ b/src/ComputeSharp.Core/Primitives/MatrixType.ttinclude @@ -9,6 +9,7 @@ void GenerateAllMatrixProperties(string typeName, int elementSize) { #> +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; <# @@ -19,7 +20,6 @@ using System.Runtime.InteropServices; #> #if !NET6_0_OR_GREATER using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif #pragma warning disable CS0660, CS0661 @@ -151,6 +151,7 @@ public unsafe partial struct <#=fullTypeName#> /// /// 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. + [UnscopedRef] public readonly ref <#=rowTypeName#> this[int row] => ref *(<#=rowTypeName#>*)UndefinedData; /// @@ -159,6 +160,7 @@ public unsafe partial struct <#=fullTypeName#> /// 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. + [UnscopedRef] public readonly ref <#=typeName#>2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(<#=typeName#>2*)UndefinedData; /// @@ -168,6 +170,7 @@ public unsafe partial struct <#=fullTypeName#> /// 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. + [UnscopedRef] public readonly ref <#=typeName#>3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(<#=typeName#>3*)UndefinedData; /// @@ -178,6 +181,7 @@ public unsafe partial struct <#=fullTypeName#> /// 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. + [UnscopedRef] 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++) @@ -192,13 +196,15 @@ public unsafe partial struct <#=fullTypeName#> if (isBoolType) { #> - public readonly ref <#=elementTypeName#> M<#=i#><#=j#> => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.As(ref Unsafe.AsRef(in this.m<#=i#><#=j#>)), 1)); + [UnscopedRef] + public readonly ref <#=elementTypeName#> M<#=i#><#=j#> => ref Unsafe.As(ref this.m<#=i#><#=j#>); <# } else { #> - public readonly ref <#=elementTypeName#> M<#=i#><#=j#> => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref Unsafe.AsRef(in this.m<#=i#><#=j#>), 1)); + [UnscopedRef] + public readonly ref <#=elementTypeName#> M<#=i#><#=j#> => ref this.m<#=i#><#=j#>; <# } #> diff --git a/src/ComputeSharp.Core/Primitives/UInt/UIntMxN.g.cs b/src/ComputeSharp.Core/Primitives/UInt/UIntMxN.g.cs index 4a5fefa6..b3bc25db 100644 --- a/src/ComputeSharp.Core/Primitives/UInt/UIntMxN.g.cs +++ b/src/ComputeSharp.Core/Primitives/UInt/UIntMxN.g.cs @@ -1,8 +1,8 @@ -using System.Runtime.CompilerServices; +using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if !NET6_0_OR_GREATER using RuntimeHelpers = ComputeSharp.Core.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; -using MemoryMarshal = ComputeSharp.Core.NetStandard.System.Runtime.InteropServices.MemoryMarshal; #endif #pragma warning disable CS0660, CS0661 @@ -35,6 +35,7 @@ public unsafe partial struct UInt1x1 /// /// 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. + [UnscopedRef] public readonly ref uint this[int row] => ref *(uint*)UndefinedData; /// @@ -43,6 +44,7 @@ public unsafe partial struct UInt1x1 /// 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. + [UnscopedRef] public readonly ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; /// @@ -52,6 +54,7 @@ public unsafe partial struct UInt1x1 /// 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. + [UnscopedRef] public readonly ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; /// @@ -62,12 +65,14 @@ public unsafe partial struct UInt1x1 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref uint M11 => ref this.m11; /// /// Creates a new value with the same value for all its components. @@ -313,6 +318,7 @@ public unsafe partial struct UInt1x2 /// /// 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. + [UnscopedRef] public readonly ref UInt2 this[int row] => ref *(UInt2*)UndefinedData; /// @@ -321,6 +327,7 @@ public unsafe partial struct UInt1x2 /// 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. + [UnscopedRef] public readonly ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; /// @@ -330,6 +337,7 @@ public unsafe partial struct UInt1x2 /// 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. + [UnscopedRef] public readonly ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; /// @@ -340,17 +348,20 @@ public unsafe partial struct UInt1x2 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref uint M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref uint M12 => ref this.m12; /// /// Creates a new value with the same value for all its components. @@ -608,6 +619,7 @@ public unsafe partial struct UInt1x3 /// /// 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. + [UnscopedRef] public readonly ref UInt3 this[int row] => ref *(UInt3*)UndefinedData; /// @@ -616,6 +628,7 @@ public unsafe partial struct UInt1x3 /// 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. + [UnscopedRef] public readonly ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; /// @@ -625,6 +638,7 @@ public unsafe partial struct UInt1x3 /// 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. + [UnscopedRef] public readonly ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; /// @@ -635,22 +649,26 @@ public unsafe partial struct UInt1x3 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref uint M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref uint M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref uint M13 => ref this.m13; /// /// Creates a new value with the same value for all its components. @@ -914,6 +932,7 @@ public unsafe partial struct UInt1x4 /// /// 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. + [UnscopedRef] public readonly ref UInt4 this[int row] => ref *(UInt4*)UndefinedData; /// @@ -922,6 +941,7 @@ public unsafe partial struct UInt1x4 /// 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. + [UnscopedRef] public readonly ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; /// @@ -931,6 +951,7 @@ public unsafe partial struct UInt1x4 /// 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. + [UnscopedRef] public readonly ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; /// @@ -941,27 +962,32 @@ public unsafe partial struct UInt1x4 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref uint M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref uint M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref uint M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref uint M14 => ref this.m14; /// /// Creates a new value with the same value for all its components. @@ -1216,6 +1242,7 @@ public unsafe partial struct UInt2x1 /// /// 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. + [UnscopedRef] public readonly ref uint this[int row] => ref *(uint*)UndefinedData; /// @@ -1224,6 +1251,7 @@ public unsafe partial struct UInt2x1 /// 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. + [UnscopedRef] public readonly ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; /// @@ -1233,6 +1261,7 @@ public unsafe partial struct UInt2x1 /// 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. + [UnscopedRef] public readonly ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; /// @@ -1243,17 +1272,20 @@ public unsafe partial struct UInt2x1 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref uint M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref uint M21 => ref this.m21; /// /// Creates a new value with the same value for all its components. @@ -1529,6 +1561,7 @@ public unsafe partial struct UInt2x2 /// /// 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. + [UnscopedRef] public readonly ref UInt2 this[int row] => ref *(UInt2*)UndefinedData; /// @@ -1537,6 +1570,7 @@ public unsafe partial struct UInt2x2 /// 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. + [UnscopedRef] public readonly ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; /// @@ -1546,6 +1580,7 @@ public unsafe partial struct UInt2x2 /// 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. + [UnscopedRef] public readonly ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; /// @@ -1556,27 +1591,32 @@ public unsafe partial struct UInt2x2 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref uint M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref uint M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref uint M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref uint M22 => ref this.m22; /// /// Creates a new value with the same value for all its components. @@ -1860,6 +1900,7 @@ public unsafe partial struct UInt2x3 /// /// 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. + [UnscopedRef] public readonly ref UInt3 this[int row] => ref *(UInt3*)UndefinedData; /// @@ -1868,6 +1909,7 @@ public unsafe partial struct UInt2x3 /// 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. + [UnscopedRef] public readonly ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; /// @@ -1877,6 +1919,7 @@ public unsafe partial struct UInt2x3 /// 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. + [UnscopedRef] public readonly ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; /// @@ -1887,37 +1930,44 @@ public unsafe partial struct UInt2x3 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref uint M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref uint M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref uint M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref uint M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref uint M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref uint M23 => ref this.m23; /// /// Creates a new value with the same value for all its components. @@ -2215,6 +2265,7 @@ public unsafe partial struct UInt2x4 /// /// 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. + [UnscopedRef] public readonly ref UInt4 this[int row] => ref *(UInt4*)UndefinedData; /// @@ -2223,6 +2274,7 @@ public unsafe partial struct UInt2x4 /// 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. + [UnscopedRef] public readonly ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; /// @@ -2232,6 +2284,7 @@ public unsafe partial struct UInt2x4 /// 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. + [UnscopedRef] public readonly ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; /// @@ -2242,47 +2295,56 @@ public unsafe partial struct UInt2x4 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref uint M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref uint M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref uint M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref uint M14 => ref this.m14; /// /// 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)); + [UnscopedRef] + public readonly ref uint M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref uint M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref uint M23 => ref this.m23; /// /// 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)); + [UnscopedRef] + public readonly ref uint M24 => ref this.m24; /// /// Creates a new value with the same value for all its components. @@ -2540,6 +2602,7 @@ public unsafe partial struct UInt3x1 /// /// 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. + [UnscopedRef] public readonly ref uint this[int row] => ref *(uint*)UndefinedData; /// @@ -2548,6 +2611,7 @@ public unsafe partial struct UInt3x1 /// 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. + [UnscopedRef] public readonly ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; /// @@ -2557,6 +2621,7 @@ public unsafe partial struct UInt3x1 /// 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. + [UnscopedRef] public readonly ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; /// @@ -2567,22 +2632,26 @@ public unsafe partial struct UInt3x1 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref uint M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref uint M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref uint M31 => ref this.m31; /// /// Creates a new value with the same value for all its components. @@ -2872,6 +2941,7 @@ public unsafe partial struct UInt3x2 /// /// 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. + [UnscopedRef] public readonly ref UInt2 this[int row] => ref *(UInt2*)UndefinedData; /// @@ -2880,6 +2950,7 @@ public unsafe partial struct UInt3x2 /// 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. + [UnscopedRef] public readonly ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; /// @@ -2889,6 +2960,7 @@ public unsafe partial struct UInt3x2 /// 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. + [UnscopedRef] public readonly ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; /// @@ -2899,37 +2971,44 @@ public unsafe partial struct UInt3x2 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref uint M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref uint M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref uint M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref uint M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref uint M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref uint M32 => ref this.m32; /// /// Creates a new value with the same value for all its components. @@ -3234,6 +3313,7 @@ public unsafe partial struct UInt3x3 /// /// 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. + [UnscopedRef] public readonly ref UInt3 this[int row] => ref *(UInt3*)UndefinedData; /// @@ -3242,6 +3322,7 @@ public unsafe partial struct UInt3x3 /// 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. + [UnscopedRef] public readonly ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; /// @@ -3251,6 +3332,7 @@ public unsafe partial struct UInt3x3 /// 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. + [UnscopedRef] public readonly ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; /// @@ -3261,52 +3343,62 @@ public unsafe partial struct UInt3x3 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref uint M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref uint M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref uint M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref uint M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref uint M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref uint M23 => ref this.m23; /// /// 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)); + [UnscopedRef] + public readonly ref uint M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref uint M32 => ref this.m32; /// /// 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)); + [UnscopedRef] + public readonly ref uint M33 => ref this.m33; /// /// Creates a new value with the same value for all its components. @@ -3632,6 +3724,7 @@ public unsafe partial struct UInt3x4 /// /// 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. + [UnscopedRef] public readonly ref UInt4 this[int row] => ref *(UInt4*)UndefinedData; /// @@ -3640,6 +3733,7 @@ public unsafe partial struct UInt3x4 /// 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. + [UnscopedRef] public readonly ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; /// @@ -3649,6 +3743,7 @@ public unsafe partial struct UInt3x4 /// 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. + [UnscopedRef] public readonly ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; /// @@ -3659,67 +3754,80 @@ public unsafe partial struct UInt3x4 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref uint M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref uint M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref uint M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref uint M14 => ref this.m14; /// /// 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)); + [UnscopedRef] + public readonly ref uint M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref uint M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref uint M23 => ref this.m23; /// /// 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)); + [UnscopedRef] + public readonly ref uint M24 => ref this.m24; /// /// 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)); + [UnscopedRef] + public readonly ref uint M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref uint M32 => ref this.m32; /// /// 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)); + [UnscopedRef] + public readonly ref uint M33 => ref this.m33; /// /// 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)); + [UnscopedRef] + public readonly ref uint M34 => ref this.m34; /// /// Creates a new value with the same value for all its components. @@ -3986,6 +4094,7 @@ public unsafe partial struct UInt4x1 /// /// 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. + [UnscopedRef] public readonly ref uint this[int row] => ref *(uint*)UndefinedData; /// @@ -3994,6 +4103,7 @@ public unsafe partial struct UInt4x1 /// 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. + [UnscopedRef] public readonly ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; /// @@ -4003,6 +4113,7 @@ public unsafe partial struct UInt4x1 /// 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. + [UnscopedRef] public readonly ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; /// @@ -4013,27 +4124,32 @@ public unsafe partial struct UInt4x1 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref uint M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref uint M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref uint M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref uint M41 => ref this.m41; /// /// Creates a new value with the same value for all its components. @@ -4337,6 +4453,7 @@ public unsafe partial struct UInt4x2 /// /// 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. + [UnscopedRef] public readonly ref UInt2 this[int row] => ref *(UInt2*)UndefinedData; /// @@ -4345,6 +4462,7 @@ public unsafe partial struct UInt4x2 /// 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. + [UnscopedRef] public readonly ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; /// @@ -4354,6 +4472,7 @@ public unsafe partial struct UInt4x2 /// 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. + [UnscopedRef] public readonly ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; /// @@ -4364,47 +4483,56 @@ public unsafe partial struct UInt4x2 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref uint M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref uint M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref uint M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref uint M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref uint M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref uint M32 => ref this.m32; /// /// 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)); + [UnscopedRef] + public readonly ref uint M41 => ref this.m41; /// /// 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)); + [UnscopedRef] + public readonly ref uint M42 => ref this.m42; /// /// Creates a new value with the same value for all its components. @@ -4730,6 +4858,7 @@ public unsafe partial struct UInt4x3 /// /// 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. + [UnscopedRef] public readonly ref UInt3 this[int row] => ref *(UInt3*)UndefinedData; /// @@ -4738,6 +4867,7 @@ public unsafe partial struct UInt4x3 /// 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. + [UnscopedRef] public readonly ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; /// @@ -4747,6 +4877,7 @@ public unsafe partial struct UInt4x3 /// 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. + [UnscopedRef] public readonly ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; /// @@ -4757,67 +4888,80 @@ public unsafe partial struct UInt4x3 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref uint M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref uint M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref uint M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref uint M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref uint M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref uint M23 => ref this.m23; /// /// 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)); + [UnscopedRef] + public readonly ref uint M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref uint M32 => ref this.m32; /// /// 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)); + [UnscopedRef] + public readonly ref uint M33 => ref this.m33; /// /// 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)); + [UnscopedRef] + public readonly ref uint M41 => ref this.m41; /// /// 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)); + [UnscopedRef] + public readonly ref uint M42 => ref this.m42; /// /// 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)); + [UnscopedRef] + public readonly ref uint M43 => ref this.m43; /// /// Creates a new value with the same value for all its components. @@ -5171,6 +5315,7 @@ public unsafe partial struct UInt4x4 /// /// 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. + [UnscopedRef] public readonly ref UInt4 this[int row] => ref *(UInt4*)UndefinedData; /// @@ -5179,6 +5324,7 @@ public unsafe partial struct UInt4x4 /// 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. + [UnscopedRef] public readonly ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(UInt2*)UndefinedData; /// @@ -5188,6 +5334,7 @@ public unsafe partial struct UInt4x4 /// 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. + [UnscopedRef] public readonly ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(UInt3*)UndefinedData; /// @@ -5198,87 +5345,104 @@ public unsafe partial struct UInt4x4 /// 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. + [UnscopedRef] 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)); + [UnscopedRef] + public readonly ref uint M11 => ref this.m11; /// /// 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)); + [UnscopedRef] + public readonly ref uint M12 => ref this.m12; /// /// 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)); + [UnscopedRef] + public readonly ref uint M13 => ref this.m13; /// /// 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)); + [UnscopedRef] + public readonly ref uint M14 => ref this.m14; /// /// 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)); + [UnscopedRef] + public readonly ref uint M21 => ref this.m21; /// /// 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)); + [UnscopedRef] + public readonly ref uint M22 => ref this.m22; /// /// 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)); + [UnscopedRef] + public readonly ref uint M23 => ref this.m23; /// /// 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)); + [UnscopedRef] + public readonly ref uint M24 => ref this.m24; /// /// 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)); + [UnscopedRef] + public readonly ref uint M31 => ref this.m31; /// /// 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)); + [UnscopedRef] + public readonly ref uint M32 => ref this.m32; /// /// 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)); + [UnscopedRef] + public readonly ref uint M33 => ref this.m33; /// /// 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)); + [UnscopedRef] + public readonly ref uint M34 => ref this.m34; /// /// 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)); + [UnscopedRef] + public readonly ref uint M41 => ref this.m41; /// /// 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)); + [UnscopedRef] + public readonly ref uint M42 => ref this.m42; /// /// 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)); + [UnscopedRef] + public readonly ref uint M43 => ref this.m43; /// /// 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)); + [UnscopedRef] + public readonly ref uint M44 => ref this.m44; /// /// Creates a new value with the same value for all its components.