Fixed shader data loading for matrix types
このコミットが含まれているのは:
1 親
ce39024e88
コミット
32ae557a25
24ファイル変更
+130
-126
検索条件に一致するファイルはありません
@@ -1,6 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace ComputeSharp.SourceGenerators.Mappings
|
||||
{
|
||||
@@ -12,38 +16,38 @@ namespace ComputeSharp.SourceGenerators.Mappings
|
||||
/// <summary>
|
||||
/// The mapping of supported known sizes to HLSL type names.
|
||||
/// </summary>
|
||||
private static IReadOnlyDictionary<string, (int, int)> KnownSizes = new Dictionary<string, (int, int)>
|
||||
private static IReadOnlyDictionary<string, (int, int)> KnownSizes = BuildKnownSizesMap();
|
||||
|
||||
/// <summary>
|
||||
/// Builds the mapping of known type sizes and alignments.
|
||||
/// </summary>
|
||||
[Pure]
|
||||
private static IReadOnlyDictionary<string, (int, int)> BuildKnownSizesMap()
|
||||
{
|
||||
[typeof(bool).FullName] = (4, 4),
|
||||
[typeof(int).FullName] = (4, 4),
|
||||
[typeof(int).FullName] = (4, 4),
|
||||
[typeof(float).FullName] = (4, 4),
|
||||
[typeof(double).FullName] = (8, 8),
|
||||
Dictionary<string, (int, int)> knownSizes = new()
|
||||
{
|
||||
[typeof(bool).FullName] = (4, 4),
|
||||
[typeof(int).FullName] = (4, 4),
|
||||
[typeof(int).FullName] = (4, 4),
|
||||
[typeof(float).FullName] = (4, 4),
|
||||
[typeof(double).FullName] = (8, 8),
|
||||
|
||||
[typeof(Vector2).FullName] = (8, 4),
|
||||
[typeof(Vector3).FullName] = (12, 4),
|
||||
[typeof(Vector4).FullName] = (16, 4),
|
||||
[typeof(Vector2).FullName] = (8, 4),
|
||||
[typeof(Vector3).FullName] = (12, 4),
|
||||
[typeof(Vector4).FullName] = (16, 4)
|
||||
};
|
||||
|
||||
[typeof(Bool2).FullName] = (8, 4),
|
||||
[typeof(Bool3).FullName] = (12, 4),
|
||||
[typeof(Bool4).FullName] = (16, 4),
|
||||
foreach (
|
||||
var type in
|
||||
from type in Assembly.GetExecutingAssembly().ExportedTypes
|
||||
where Regex.IsMatch(type.FullName, @"^ComputeSharp\.(Bool|Double|Float|Int|UInt)")
|
||||
select type)
|
||||
{
|
||||
knownSizes.Add(type.FullName, (type.StructLayoutAttribute.Size, type.StructLayoutAttribute.Pack));
|
||||
}
|
||||
|
||||
[typeof(Int2).FullName] = (8, 4),
|
||||
[typeof(Int3).FullName] = (12, 4),
|
||||
[typeof(Int4).FullName] = (16, 4),
|
||||
|
||||
[typeof(UInt2).FullName] = (8, 4),
|
||||
[typeof(UInt3).FullName] = (12, 4),
|
||||
[typeof(UInt4).FullName] = (16, 4),
|
||||
|
||||
[typeof(Float2).FullName] = (8, 4),
|
||||
[typeof(Float3).FullName] = (12, 4),
|
||||
[typeof(Float4).FullName] = (16, 4),
|
||||
|
||||
[typeof(Double2).FullName] = (16, 8),
|
||||
[typeof(Double3).FullName] = (24, 8),
|
||||
[typeof(Double3).FullName] = (32, 8)
|
||||
};
|
||||
return knownSizes;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the size and alignment info for a specified primitive type.
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace ComputeSharp
|
||||
/// A <see langword="struct"/> that can be used in place of the <see cref="bool"/> type in HLSL shaders.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{Value}")]
|
||||
[StructLayout(LayoutKind.Explicit, Size = sizeof(int))]
|
||||
[StructLayout(LayoutKind.Explicit, Size = sizeof(int), Pack = 4)]
|
||||
public readonly struct Bool
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Bool2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)]
|
||||
public partial struct Bool2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
|
||||
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Bool3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)]
|
||||
public partial struct Bool3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
|
||||
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Bool4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)]
|
||||
public partial struct Bool4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
|
||||
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Bool1x1"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 4)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 4, Pack = 4)]
|
||||
public partial struct Bool1x1
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -98,7 +98,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Bool1x2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)]
|
||||
public partial struct Bool1x2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -204,7 +204,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Bool1x3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)]
|
||||
public partial struct Bool1x3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -316,7 +316,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Bool1x4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)]
|
||||
public partial struct Bool1x4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -434,7 +434,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Bool2x1"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)]
|
||||
public partial struct Bool2x1
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -540,7 +540,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Bool2x2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)]
|
||||
public partial struct Bool2x2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -665,7 +665,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Bool2x3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)]
|
||||
public partial struct Bool2x3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -804,7 +804,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Bool2x4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)]
|
||||
public partial struct Bool2x4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -957,7 +957,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Bool3x1"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)]
|
||||
public partial struct Bool3x1
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1069,7 +1069,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Bool3x2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)]
|
||||
public partial struct Bool3x2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1209,7 +1209,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Bool3x3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 36)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 36, Pack = 4)]
|
||||
public partial struct Bool3x3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1370,7 +1370,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Bool3x4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 48)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)]
|
||||
public partial struct Bool3x4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1552,7 +1552,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Bool4x1"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)]
|
||||
public partial struct Bool4x1
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1670,7 +1670,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Bool4x2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)]
|
||||
public partial struct Bool4x2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1825,7 +1825,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Bool4x3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 48)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)]
|
||||
public partial struct Bool4x3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -2008,7 +2008,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Bool4x4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 64)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 64, Pack = 4)]
|
||||
public partial struct Bool4x4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
|
||||
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Double2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 8)]
|
||||
public partial struct Double2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
|
||||
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Double3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 8)]
|
||||
public partial struct Double3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
|
||||
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Double4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 8)]
|
||||
public partial struct Double4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
|
||||
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Double1x1"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)]
|
||||
public partial struct Double1x1
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -98,7 +98,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Double1x2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 8)]
|
||||
public partial struct Double1x2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -204,7 +204,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Double1x3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 8)]
|
||||
public partial struct Double1x3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -316,7 +316,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Double1x4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 8)]
|
||||
public partial struct Double1x4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -434,7 +434,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Double2x1"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 8)]
|
||||
public partial struct Double2x1
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -540,7 +540,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Double2x2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 8)]
|
||||
public partial struct Double2x2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -665,7 +665,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Double2x3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 48)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 48, Pack = 8)]
|
||||
public partial struct Double2x3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -804,7 +804,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Double2x4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 64)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 64, Pack = 8)]
|
||||
public partial struct Double2x4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -957,7 +957,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Double3x1"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 8)]
|
||||
public partial struct Double3x1
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1069,7 +1069,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Double3x2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 48)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 48, Pack = 8)]
|
||||
public partial struct Double3x2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1209,7 +1209,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Double3x3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 72)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 72, Pack = 8)]
|
||||
public partial struct Double3x3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1370,7 +1370,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Double3x4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 96)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 96, Pack = 8)]
|
||||
public partial struct Double3x4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1552,7 +1552,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Double4x1"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 8)]
|
||||
public partial struct Double4x1
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1670,7 +1670,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Double4x2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 64)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 64, Pack = 8)]
|
||||
public partial struct Double4x2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1825,7 +1825,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Double4x3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 96)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 96, Pack = 8)]
|
||||
public partial struct Double4x3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -2008,7 +2008,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Double4x4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 128)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 128, Pack = 8)]
|
||||
public partial struct Double4x4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
|
||||
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Float2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)]
|
||||
public partial struct Float2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
|
||||
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Float3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)]
|
||||
public partial struct Float3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
|
||||
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Float4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)]
|
||||
public partial struct Float4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
|
||||
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Float1x1"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 4)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 4, Pack = 4)]
|
||||
public partial struct Float1x1
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -98,7 +98,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Float1x2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)]
|
||||
public partial struct Float1x2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -204,7 +204,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Float1x3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)]
|
||||
public partial struct Float1x3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -316,7 +316,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Float1x4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)]
|
||||
public partial struct Float1x4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -434,7 +434,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Float2x1"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)]
|
||||
public partial struct Float2x1
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -540,7 +540,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Float2x2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)]
|
||||
public partial struct Float2x2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -665,7 +665,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Float2x3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)]
|
||||
public partial struct Float2x3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -804,7 +804,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Float2x4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)]
|
||||
public partial struct Float2x4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -957,7 +957,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Float3x1"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)]
|
||||
public partial struct Float3x1
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1069,7 +1069,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Float3x2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)]
|
||||
public partial struct Float3x2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1209,7 +1209,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Float3x3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 36)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 36, Pack = 4)]
|
||||
public partial struct Float3x3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1370,7 +1370,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Float3x4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 48)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)]
|
||||
public partial struct Float3x4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1552,7 +1552,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Float4x1"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)]
|
||||
public partial struct Float4x1
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1670,7 +1670,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Float4x2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)]
|
||||
public partial struct Float4x2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1825,7 +1825,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Float4x3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 48)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)]
|
||||
public partial struct Float4x3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -2008,7 +2008,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Float4x4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 64)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 64, Pack = 4)]
|
||||
public partial struct Float4x4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
|
||||
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Int2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)]
|
||||
public partial struct Int2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
|
||||
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Int3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)]
|
||||
public partial struct Int3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
|
||||
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Int4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)]
|
||||
public partial struct Int4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
|
||||
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Int1x1"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 4)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 4, Pack = 4)]
|
||||
public partial struct Int1x1
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -98,7 +98,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Int1x2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)]
|
||||
public partial struct Int1x2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -204,7 +204,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Int1x3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)]
|
||||
public partial struct Int1x3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -316,7 +316,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Int1x4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)]
|
||||
public partial struct Int1x4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -434,7 +434,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Int2x1"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)]
|
||||
public partial struct Int2x1
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -540,7 +540,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Int2x2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)]
|
||||
public partial struct Int2x2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -665,7 +665,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Int2x3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)]
|
||||
public partial struct Int2x3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -804,7 +804,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Int2x4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)]
|
||||
public partial struct Int2x4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -957,7 +957,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Int3x1"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)]
|
||||
public partial struct Int3x1
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1069,7 +1069,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Int3x2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)]
|
||||
public partial struct Int3x2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1209,7 +1209,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Int3x3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 36)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 36, Pack = 4)]
|
||||
public partial struct Int3x3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1370,7 +1370,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Int3x4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 48)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)]
|
||||
public partial struct Int3x4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1552,7 +1552,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Int4x1"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)]
|
||||
public partial struct Int4x1
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1670,7 +1670,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Int4x2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)]
|
||||
public partial struct Int4x2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1825,7 +1825,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Int4x3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 48)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)]
|
||||
public partial struct Int4x3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -2008,7 +2008,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Int4x4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 64)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 64, Pack = 4)]
|
||||
public partial struct Int4x4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
|
||||
@@ -37,7 +37,7 @@ void GenerateMatrixProperties(string typeName, int rows, int columns, int elemen
|
||||
List<string> fieldNames = new List<string>();
|
||||
#>
|
||||
/// <inheritdoc cref="<#=fullTypeName#>"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = <#=(elementSize * rows * columns)#>)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = <#=(elementSize * rows * columns)#>, Pack = <#=elementSize#>)]
|
||||
public partial struct <#=fullTypeName#>
|
||||
{
|
||||
<#
|
||||
|
||||
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="UInt2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)]
|
||||
public partial struct UInt2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
|
||||
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="UInt3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)]
|
||||
public partial struct UInt3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
|
||||
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="UInt4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)]
|
||||
public partial struct UInt4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
|
||||
@@ -4,7 +4,7 @@ using ComputeSharp.Exceptions;
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="UInt1x1"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 4)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 4, Pack = 4)]
|
||||
public partial struct UInt1x1
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -98,7 +98,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="UInt1x2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)]
|
||||
public partial struct UInt1x2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -204,7 +204,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="UInt1x3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)]
|
||||
public partial struct UInt1x3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -316,7 +316,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="UInt1x4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)]
|
||||
public partial struct UInt1x4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -434,7 +434,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="UInt2x1"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)]
|
||||
public partial struct UInt2x1
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -540,7 +540,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="UInt2x2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)]
|
||||
public partial struct UInt2x2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -665,7 +665,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="UInt2x3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)]
|
||||
public partial struct UInt2x3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -804,7 +804,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="UInt2x4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)]
|
||||
public partial struct UInt2x4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -957,7 +957,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="UInt3x1"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)]
|
||||
public partial struct UInt3x1
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1069,7 +1069,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="UInt3x2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)]
|
||||
public partial struct UInt3x2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1209,7 +1209,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="UInt3x3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 36)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 36, Pack = 4)]
|
||||
public partial struct UInt3x3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1370,7 +1370,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="UInt3x4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 48)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)]
|
||||
public partial struct UInt3x4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1552,7 +1552,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="UInt4x1"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)]
|
||||
public partial struct UInt4x1
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1670,7 +1670,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="UInt4x2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)]
|
||||
public partial struct UInt4x2
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -1825,7 +1825,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="UInt4x3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 48)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)]
|
||||
public partial struct UInt4x3
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -2008,7 +2008,7 @@ namespace ComputeSharp
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="UInt4x4"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 64)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 64, Pack = 4)]
|
||||
public partial struct UInt4x4
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
|
||||
@@ -72,7 +72,7 @@ using ComputeSharp.Exceptions;
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="<#=typeName#>"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = <#=(elementSize * i)#>)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = <#=(elementSize * i)#>, Pack = <#=elementSize#>)]
|
||||
public partial struct <#=typeName#>
|
||||
{
|
||||
<#
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする