muffin v7.5.5
This commit is contained in:
parent
a8f2c1df37
commit
6266f9e6b7
110 changed files with 14907 additions and 6073 deletions
26
Auspex/Auspex.Vfx.Internal/PinnedAlignedMatrix.cs
Normal file
26
Auspex/Auspex.Vfx.Internal/PinnedAlignedMatrix.cs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
using System;
|
||||
using System.Numerics;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Auspex.Vfx.Internal;
|
||||
|
||||
internal sealed class PinnedAlignedMatrix : IDisposable
|
||||
{
|
||||
private IntPtr rawptr;
|
||||
|
||||
private IntPtr aligned;
|
||||
|
||||
public unsafe Matrix4x4* Get => (Matrix4x4*)aligned;
|
||||
|
||||
public unsafe PinnedAlignedMatrix()
|
||||
{
|
||||
rawptr = Marshal.AllocHGlobal(sizeof(Matrix4x4) + 8);
|
||||
aligned = new IntPtr(16 * (((long)(nint)rawptr + 15L) / 16));
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Marshal.FreeHGlobal(rawptr);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue