daily update on 20240104 by nitload youmu, double threading not work
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8)]
|
||||
public struct GLfixed
|
||||
{
|
||||
[FieldOffset(0)] public int All;
|
||||
[FieldOffset(0)] public short Decimals;
|
||||
[FieldOffset(4)] public short Inertger;
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Numerics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
||||
|
||||
namespace StgSharp
|
||||
{
|
||||
internal static partial class InternalIO
|
||||
{
|
||||
[DllImport(InternalIO.SSC_libname, EntryPoint = "set_Vector4ptr_default",
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern IntPtr set_Vector4ptr_default_internal();
|
||||
|
||||
|
||||
#region deinit Vector4
|
||||
|
||||
[DllImport(
|
||||
"msvcrt.dll",
|
||||
EntryPoint = "_aligned_free",
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static extern unsafe void deinit_internal(Vector4* ptr);
|
||||
|
||||
[DllImport(
|
||||
"msvcrt.dll",
|
||||
EntryPoint = "_aligned_free",
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static extern unsafe void deinit_internal(Mat2* ptr);
|
||||
|
||||
/*
|
||||
[DllImport(
|
||||
"msvcrt.dll",
|
||||
EntryPoint = "_aligned_free",
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static extern unsafe void deinit_internal(Mat3* ptr);
|
||||
*/
|
||||
|
||||
[DllImport(
|
||||
"msvcrt.dll",
|
||||
EntryPoint = "_aligned_free",
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static extern unsafe void deinit_internal(Mat4* ptr);
|
||||
|
||||
[DllImport(InternalIO.SSC_libname, EntryPoint = "deinitVector4",
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern void deinitVector4_internal(ref Vector4 vec);
|
||||
|
||||
[DllImport(InternalIO.SSC_libname, EntryPoint = "deinitVector4",
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern unsafe void deinitVector4_internal(Vector4* vec);
|
||||
|
||||
#endregion
|
||||
|
||||
[DllImport(InternalIO.SSC_libname, EntryPoint = "deinit_matmapPtr_sse",
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern void deinitMatmapPtr_sse_internal(ref Vector4Map mapPtr);
|
||||
|
||||
[DllImport(InternalIO.SSC_libname, EntryPoint = "deinit_matmap_sse",
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern void deinitMatmap_sse_internal(ref Vector4Map mapPtr);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
using StgSharp;
|
||||
using StgSharp.Controlling;
|
||||
using StgSharp.Logic;
|
||||
using System.Numerics;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
public unsafe class Vector4Map
|
||||
{
|
||||
public readonly long mapID;
|
||||
internal long mapPtr;
|
||||
internal readonly StgSharp.LinkedListNode<long> _unusedVector4Header;
|
||||
private const int mapSize = 30 * 30;
|
||||
|
||||
internal StgSharp.LinkedList<long> vector4Map =
|
||||
new StgSharp.LinkedList<long>();
|
||||
|
||||
public bool isFull
|
||||
{
|
||||
get
|
||||
{
|
||||
return _unusedVector4Header == vector4Map._hook;
|
||||
}
|
||||
}
|
||||
|
||||
public Vector4Map()
|
||||
{
|
||||
mapPtr = (long)(Marshal.AllocHGlobal(sizeof(Vector4)*mapSize)+15);
|
||||
|
||||
long firstVector4ptr = (mapPtr / 16 + 1) * 16;
|
||||
|
||||
vector4Map.Add(0);
|
||||
_unusedVector4Header = vector4Map._hook._next;
|
||||
|
||||
for (int i = 0; i < 4*30*30*4; i+=16)
|
||||
{
|
||||
vector4Map.Add(firstVector4ptr+i);
|
||||
}
|
||||
|
||||
mapID = Scaler.RandomSeed();
|
||||
}
|
||||
|
||||
internal long RegistManagedVector4Ptr()
|
||||
{
|
||||
LinkedListNode<long> Vector4 = _unusedVector4Header._next;
|
||||
LinkedListNode<long> Vector4Previous = _unusedVector4Header._previous;
|
||||
|
||||
Vector4._next._previous = _unusedVector4Header.Next;
|
||||
Vector4Previous._next = Vector4;
|
||||
Vector4._previous = Vector4Previous;
|
||||
_unusedVector4Header._next = Vector4._next;
|
||||
Vector4._next = _unusedVector4Header;
|
||||
_unusedVector4Header._previous = Vector4;
|
||||
|
||||
return Vector4._value;
|
||||
|
||||
}
|
||||
|
||||
internal void RecycleManagedVector4Ptr()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
|
||||
public static unsafe partial class SSE
|
||||
{
|
||||
public static int Vector4Size = 16;
|
||||
|
||||
internal static IntPtr defaultVector4Ptr =
|
||||
InternalIO.set_Vector4ptr_default_internal();
|
||||
|
||||
|
||||
internal static IntPtr defaultM256Ptr;
|
||||
|
||||
|
||||
public enum Registor : byte
|
||||
{
|
||||
XMM0 = 0,
|
||||
XMM1 = 1,
|
||||
XMM2 = 2,
|
||||
XMM3 = 3,
|
||||
XMM4 = 4,
|
||||
XMM5 = 5,
|
||||
XMM6 = 6,
|
||||
XMM7 = 7
|
||||
}
|
||||
|
||||
static SSE()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 32)]
|
||||
internal struct M256
|
||||
{
|
||||
[FieldOffset(0)] public float single_0;
|
||||
[FieldOffset(4)] public float single_1;
|
||||
[FieldOffset(8)] public float single_2;
|
||||
[FieldOffset(12)] public float single_3;
|
||||
[FieldOffset(16)] public float single_4;
|
||||
[FieldOffset(20)] public float single_5;
|
||||
[FieldOffset(24)] public float single_6;
|
||||
[FieldOffset(28)] public float single_7;
|
||||
|
||||
[FieldOffset(0)] public long uint64_0;
|
||||
[FieldOffset(8)] public long uint64_1;
|
||||
[FieldOffset(16)] public long uint64_2;
|
||||
[FieldOffset(24)] public long uint64_3;
|
||||
|
||||
[FieldOffset(0)] public double double_0;
|
||||
[FieldOffset(8)] public double double_1;
|
||||
[FieldOffset(16)] public double double_2;
|
||||
[FieldOffset(24)] public double double_3;
|
||||
|
||||
[FieldOffset(0)] public IntPtr ptr_0;
|
||||
[FieldOffset(8)] public IntPtr ptr_1;
|
||||
[FieldOffset(16)] public IntPtr ptr_2;
|
||||
[FieldOffset(24)] public IntPtr ptr_3;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Controlling
|
||||
{
|
||||
internal static unsafe partial class TimeLine
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
/// <summary>
|
||||
/// OpenGL numeric type.
|
||||
/// An IEEE-754 floating-point value, clamped to the range [0,1].
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct GLclampf
|
||||
{
|
||||
public float value;
|
||||
|
||||
public GLclampf(float a)
|
||||
{
|
||||
value = a;
|
||||
}
|
||||
|
||||
public static explicit operator GLclampf(float v)
|
||||
{
|
||||
return new GLclampf(v);
|
||||
}
|
||||
|
||||
public static explicit operator float(GLclampf v)
|
||||
{
|
||||
return v.value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// OpenGL numeric type.
|
||||
/// An IEEE-754 double precision floating-point value, clamped to the range [0,1].
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct GLclampd
|
||||
{
|
||||
public double value;
|
||||
|
||||
public GLclampd(double a)
|
||||
{
|
||||
value = a;
|
||||
}
|
||||
|
||||
public static explicit operator GLclampd(double v)
|
||||
{
|
||||
return new GLclampd(v);
|
||||
}
|
||||
|
||||
public static explicit operator double(GLclampd v)
|
||||
{
|
||||
return v.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
public struct GLhalfNV
|
||||
{
|
||||
[FieldOffset(0)] public short binary;
|
||||
|
||||
public GLhalfNV(short bin)
|
||||
{
|
||||
binary = bin;
|
||||
}
|
||||
|
||||
public static explicit operator short(GLhalfNV x)
|
||||
{
|
||||
return x.binary;
|
||||
}
|
||||
|
||||
public static explicit operator GLhalfNV(short x)
|
||||
{
|
||||
return new GLhalfNV(x);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user