daily update on 20241228 by nitload youmu, better dot in checking

This commit is contained in:
Nitload
2024-12-29 04:30:40 +08:00
parent 592ad55d57
commit 63c3cd17e2
45 changed files with 7193 additions and 4884 deletions
@@ -57,6 +57,7 @@ namespace StgSharp.Data.Intrinsic
internal ColumnSet2( Vector4 c0, Vector4 c1 )
{
Unsafe.SkipInit( out this );
colum0 = c0;
colum1 = c1;
}
@@ -43,17 +43,14 @@ namespace StgSharp.Data.Intrinsic
internal struct ColumnSet4 : IEquatable<ColumnSet4>, IMat
{
[FieldOffset( 0 )] internal Vector4 colum0;
[FieldOffset( 0 )] internal Vector4 colum0;
[FieldOffset( 16 )] internal Vector4 colum1;
[FieldOffset( 32 )] internal Vector4 colum2;
[FieldOffset( 48 )] internal Vector4 colum3;
[FieldOffset( 0 )] public float m00;
[FieldOffset( 16 )] public float m01;
[FieldOffset( 32 )] public float m02;
[FieldOffset( 48 )] public float m03;
[FieldOffset( 4 )] public float m10;
[FieldOffset( 20 )] public float m11;
@@ -70,11 +67,12 @@ namespace StgSharp.Data.Intrinsic
[MethodImpl( MethodImplOptions.AggressiveInlining )]
internal ColumnSet4(
Vector4 colum0,
Vector4 colum1,
Vector4 colum2,
Vector4 colum3 )
Vector4 colum0,
Vector4 colum1,
Vector4 colum2,
Vector4 colum3 )
{
Unsafe.SkipInit( out this );
this.colum0 = colum0;
this.colum1 = colum1;
this.colum2 = colum2;
@@ -33,6 +33,7 @@ using StgSharp.Math;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
@@ -48,6 +49,10 @@ namespace StgSharp.Data.Intrinsic
public delegate* unmanaged[Cdecl]<ColumnSet4*, ColumnSet4*, ColumnSet4*, void> add_mat_4;
public delegate* unmanaged[Cdecl]<ColumnSet3*, ColumnSet3*, float> det_mat_3;
public delegate* unmanaged[Cdecl]<ColumnSet4*, ColumnSet4*, float> det_mat_4;
public delegate* unmanaged[Cdecl]<ColumnSet3*, Vector4*, Vector4*, void> dot_31;
public delegate* unmanaged[Cdecl]<ColumnSet3*, Vector4*, Vector4*, void> dot_32;
public delegate* unmanaged[Cdecl]<ColumnSet4*, Vector4*, Vector4*, void> dot_41;
public delegate* unmanaged[Cdecl]<ColumnSet4*, Vector4*, Vector4*, void> dot_42;
public delegate* unmanaged[Cdecl]<M128*, M128*, void> normalize_v3;
public delegate* unmanaged[Cdecl]<char*, int, int> string_quickHash;
public delegate* unmanaged[Cdecl]<ColumnSet2*, ColumnSet3*, void> transpose23;
@@ -46,7 +46,6 @@ namespace StgSharp.Data.Intrinsic
[StructLayout( LayoutKind.Explicit, Pack = 16 )]
public unsafe struct M128 : IRegisterType
{
[FieldOffset( 0 )] internal Vector4 vec;
internal M128( Vector4 v )
@@ -208,7 +208,6 @@ namespace StgSharp.Math
fixed( ColumnSet4* source = &mat, target = &transpose ) {
InternalIO.Intrinsic.transpose44( source, target );
}
isTransposed = true;
}
}
@@ -238,12 +237,27 @@ namespace StgSharp.Math
mat.mat.colum2 * value, mat.mat.colum3 * value );
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe Matrix42 Multiple(in Matrix42 right)
{
InternalTranspose();
Matrix42 ans = new Matrix42();
fixed (ColumnSet4* lptr = &transpose)
fixed (Vector4* rptr = &right.mat.colum0)
{
InternalIO.Intrinsic.dot_42(lptr,rptr, &ans.mat.colum0);
}
return ans;
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static unsafe Matrix42 operator *(
Matrix44 left,
Matrix42 right )
{
left.InternalTranspose();
return new Matrix42(
Vector4.Dot( left.transpose.colum0, right.mat.colum0 ),
Vector4.Dot( left.transpose.colum0, right.mat.colum1 ),
@@ -280,6 +294,7 @@ namespace StgSharp.Math
Vector4.Dot( left.transpose.colum3, right.mat.colum2 ) );
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static Matrix44 operator *( Matrix44 left, Matrix44 right )
{
@@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+7c8d462ca5da46abdfb0e7278f81d25abe890887")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+592ad55d57752262ac1a710ef11425da83ef4676")]
[assembly: System.Reflection.AssemblyProductAttribute("StgSharp")]
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharp")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]