daily update on 20230911 by nitload youmu, uncertain bug of gl api loading

This commit is contained in:
Nitload
2023-09-11 23:34:34 +08:00
parent c6f4b3dd53
commit 5d701bce0c
172 changed files with 15161 additions and 9614 deletions
+5 -93
View File
@@ -1,8 +1,6 @@
using StgSharp.Math;
using System;
using System.Collections.Generic;
using System.Numerics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -12,97 +10,11 @@ namespace StgSharp
{
internal static partial class internalIO
{
#region load
[DllImport(dllName: "StgSharpGraphic", EntryPoint = "load",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern ref Vector4 load_internal(float x,float y, float z, float w);
[DllImport(dllName: "StgSharpGraphic", EntryPoint = "load",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static unsafe extern Vector4* loadptr_internal(float x, float y, float z, float w);
[DllImport("StgSharpGraphic",EntryPoint = "load_matmap",
CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr load_mat(IntPtr c0, IntPtr c1, IntPtr c2, IntPtr c3);
[DllImport("StgSharpGraphic", EntryPoint = "load_cpy",
CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr load_cpy_internal(IntPtr ptr);
#endregion
#region add sub
[DllImport("StgSharpGraphic", EntryPoint = "addps",
CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr addps_internal(IntPtr ptr1, IntPtr ptr2);
[DllImport("StgSharpGraphic", EntryPoint = "subps",
CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr subps_internal(IntPtr ptr1, IntPtr ptr2);
#endregion
#region mulps
[DllImport("StgSharpGraphic", EntryPoint = "mulps",
CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr mulps_internal(IntPtr ptr1, IntPtr ptr2);
[DllImport("StgSharpGraphic", EntryPoint = "mulps_const",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern IntPtr mulps_const_internal(IntPtr ptr, float value);
[DllImport("StgSharpGraphic", EntryPoint = "mulps_sum",
CallingConvention = CallingConvention.Cdecl)]
internal static extern float mulps_sum_internal(IntPtr ptr1, IntPtr ptr2);
[DllImport("StgSharpGraphic", EntryPoint = "mulps_sum",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe float mulps_sum_internal(Vector4* ptr1, Vector4* ptr2);
[DllImport("StgSharpGraphic", EntryPoint = "mulps_sum",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe float mulps_sum_internal(Vec4d* ptr1, Vec4d* ptr2);
#endregion
#region div
[DllImport("StgSharpGraphic", EntryPoint = "mulps",
CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr divps_internal(IntPtr ptr1, IntPtr ptr2);
[DllImport("StgSharpGraphic", EntryPoint = "divps_const",
CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr divps_const_internal(IntPtr ptr, float value);
#endregion
[DllImport("StgSharpGraphic", EntryPoint = "sqrtss_const",
CallingConvention = CallingConvention.Cdecl)]
internal static extern float sqrtss_const_internal(float a);
[DllImport("StgSharpGraphic", EntryPoint = "set_Vector4ptr_default",
[DllImport(SSGC_libname, EntryPoint = "set_Vector4ptr_default",
CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr set_Vector4ptr_default_internal();
#region deinit Vector4
[DllImport(
@@ -135,21 +47,21 @@ namespace StgSharp
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern unsafe void deinit_internal(Mat4* ptr);
[DllImport("StgSharpGraphic", EntryPoint = "deinitVector4",
[DllImport(SSGC_libname, EntryPoint = "deinitVector4",
CallingConvention = CallingConvention.Cdecl)]
internal static extern void deinitVector4_internal(ref Vector4 vec);
[DllImport("StgSharpGraphic", EntryPoint = "deinitVector4",
[DllImport(SSGC_libname, EntryPoint = "deinitVector4",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void deinitVector4_internal(Vector4* vec);
#endregion
[DllImport("StgSharpGraphic", EntryPoint = "deinit_matmapPtr_sse",
[DllImport(SSGC_libname, EntryPoint = "deinit_matmapPtr_sse",
CallingConvention = CallingConvention.Cdecl)]
internal static extern void deinitMatmapPtr_sse_internal(ref Vector4Map mapPtr);
[DllImport("StgSharpGraphic", EntryPoint = "deinit_matmap_sse",
[DllImport(SSGC_libname, EntryPoint = "deinit_matmap_sse",
CallingConvention = CallingConvention.Cdecl)]
internal static extern void deinitMatmap_sse_internal(ref Vector4Map mapPtr);
+1 -1
View File
@@ -1,5 +1,5 @@
using StgSharp;
using StgSharp.Control;
using StgSharp.Controlling;
using StgSharp.Logic;
using System.Numerics;
using System.Runtime.InteropServices;
+1 -1
View File
@@ -3,7 +3,7 @@ using System;
using System.Collections.Generic;
using System.Text;
namespace StgSharp.Control
namespace StgSharp.Controlling
{
public static unsafe partial class TimeLine
{
+5 -6
View File
@@ -10,7 +10,7 @@ namespace StgSharp
{
#region add
[DllImport("StgsharpGraphic", EntryPoint = "add_Mat2",
[DllImport(SSGC_libname, EntryPoint = "add_Mat2",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern Mat2* add_mat2(Mat2* left, Mat2* right);
@@ -20,23 +20,22 @@ namespace StgSharp
#region sub
[DllImport("StgsharpGraphic", EntryPoint = "sub_mat2",
[DllImport(SSGC_libname, EntryPoint = "sub_mat2",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern unsafe Mat2* sub_mat2(Mat2* left, Mat2* right);
#endregion
#region transpose
[DllImport("StgsharpGraphic", EntryPoint = "transmpose2to4",
[DllImport(SSGC_libname, EntryPoint = "transmpose2to4",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern unsafe void Transpose2to4_internal(Mat2* source, Mat4* target);
[DllImport("StgsharpGraphic", EntryPoint = "transmpose2to3",
[DllImport(SSGC_libname, EntryPoint = "transmpose2to3",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern unsafe void Transpose2to3_internal(Mat2* source, Mat3* target);
@@ -45,7 +44,7 @@ namespace StgSharp
#region deinit mat2
[DllImport("StgsharpGraphic", EntryPoint = "deinit_mat2",
[DllImport(SSGC_libname, EntryPoint = "deinit_mat2",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern unsafe void deinit_mat2(Mat2* mat);
+4 -4
View File
@@ -11,7 +11,7 @@ namespace StgSharp
#region det
[DllImport("StgsharpGraphic", EntryPoint = "det_mat3",
[DllImport(SSGC_libname, EntryPoint = "det_mat3",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern unsafe float det_mat3(Mat3* mat);
@@ -20,18 +20,18 @@ namespace StgSharp
#region transpose
[DllImport("StgsharpGraphic", EntryPoint = "transpose3to4",
[DllImport(SSGC_libname, EntryPoint = "transpose3to4",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void Transpose3to4_internal(Mat3* source, Mat4* target);
[DllImport("StgsharpGra[hic", EntryPoint = "transpose3to4",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void Transpose3to3_internal(Mat3* source, Mat3* target);
[DllImport("StgsharpGra[hic", EntryPoint = "transpose3to2",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void Transpose3to2_internal(Mat3* source, Mat2* target);
#endregion
}
+5 -5
View File
@@ -12,15 +12,15 @@ namespace StgSharp
#region transpose
[DllImport("StgsharpGraphic", EntryPoint = "transpose4to4",
[DllImport(SSGC_libname, EntryPoint = "transpose4to4",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void Transpose4to4_internal(Mat4* source, Mat4* target);
[DllImport("StgsharpGraphic", EntryPoint = "transpose4to3",
[DllImport(SSGC_libname, EntryPoint = "transpose4to3",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void Transpose4to3_internal(Mat4* source, Mat3* target);
[DllImport("StgsharpGraphic", EntryPoint = "transpose4to2",
[DllImport(SSGC_libname, EntryPoint = "transpose4to2",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void Transpose4to2_internal(Mat4* source, Mat2* target);
@@ -29,7 +29,7 @@ namespace StgSharp
#region det
[DllImport("StgsharpGraphic", EntryPoint = "det_mat4",
[DllImport(SSGC_libname, EntryPoint = "det_mat4",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static unsafe extern float det_mat4(Mat4* matPtr, Mat4* transpose);
@@ -39,7 +39,7 @@ namespace StgSharp
#region deinit_mat4
[DllImport("StgSharpGraphic", EntryPoint = "deinit_mat4",
[DllImport(SSGC_libname, EntryPoint = "deinit_mat4",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern void deinit_mat4(Mat4* mat);
+1 -1
View File
@@ -1,4 +1,4 @@
using StgSharp.Control;
using StgSharp.Controlling;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
+1 -1
View File
@@ -1,4 +1,4 @@
using StgSharp.Control;
using StgSharp.Controlling;
using StgSharp.Math;
using System.Numerics;
using System.Runtime.InteropServices;
+1 -1
View File
@@ -1,4 +1,4 @@
using StgSharp.Control;
using StgSharp.Controlling;
using System;
using System.Collections.Generic;
using System.Text;
+1 -10
View File
@@ -8,16 +8,7 @@ namespace StgSharp.Math
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float Sqrt(float x)
{
/**/
#if NET6_0_OR_GREATER
return System.MathF.Sqrt(x);
#else
/**/
return internalIO.sqrtss_const_internal(x);
/**/
#endif
return MathF.Sqrt(x);
/**/
}