daily update on 20230927 by nitload youmu, all polygon4 display available, optimizing on C/C# interoperation

This commit is contained in:
Nitload
2023-09-28 01:43:27 +08:00
parent 5d701bce0c
commit 6c3349f5a2
130 changed files with 3280 additions and 25074 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+17
View File
@@ -16,6 +16,22 @@ namespace StgSharp
CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
internal static extern unsafe int InternalInitGLAD();
[DllImport(SSGC_libname, EntryPoint = "loadShaderCode",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe uint InternalLoadShaderCode(byte* shaderCode, int shaderType);
[DllImport(SSGC_libname, EntryPoint = "linkShaderProgram",
CallingConvention = CallingConvention.Cdecl)]
internal static extern uint InternalLinkShaderProgram(uint shaderProgram);
[DllImport(SSGC_libname, EntryPoint = "readLog",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe IntPtr InternalReadLog();
#region GLFW
[DllImport(SSGC_libname, EntryPoint = "glfwGetWindowUserPointer",
CallingConvention = CallingConvention.Cdecl)]
@@ -393,6 +409,7 @@ namespace StgSharp
[DllImport(SSGC_libname, EntryPoint = "byte*", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe byte* glfwGetClipboardString(GLFWwindow* window);
#endregion
//
+1 -6
View File
@@ -1,9 +1,4 @@
//
#define WINDOWS
//#define LINUX
//#define MACOS
//#define IOS
//#define ANDROID
using StgSharp.Geometries;
using System;
@@ -12,11 +12,11 @@ namespace StgSharp.Geometries
internal GetLocationHandler movBeginOperation = new GetLocationHandler(GeometryOperation.DefualtMotion);
internal GetLocationHandler movEndOperation = new GetLocationHandler(GeometryOperation.DefualtMotion);
public override Point RefPoint01 => center;
public override Point RefPoint0 => center;
public override Point RefPoint02 => beginPoint;
public override Point RefPoint1 => beginPoint;
public override Point RefPoint03 => endPoint;
public override Point RefPoint2 => endPoint;
public virtual Vec3d MoveCenter(uint tick) => movCenterOperation.Invoke(tick);
@@ -13,11 +13,11 @@ namespace StgSharp.Geometries
internal GetLocationHandler movEndOperation = new GetLocationHandler(GeometryOperation.DefualtMotion);
public override Point RefPoint01 => center;
public override Point RefPoint0 => center;
public override Point RefPoint02 => pointOnCircle;
public override Point RefPoint1 => pointOnCircle;
public override Point RefPoint03 => pointOnPlain;
public override Point RefPoint2 => pointOnPlain;
public virtual Vec3d MoveCenter(uint tick) => movCenterOperation.Invoke(tick);
@@ -11,12 +11,9 @@
public Point RefOrigin { get { return refOrigin; } }
public abstract Point RefPoint01
{
get;
}
public abstract Point RefPoint02 { get; }
public abstract Point RefPoint03 { get; }
public abstract Point RefPoint0 { get; }
public abstract Point RefPoint1 { get; }
public abstract Point RefPoint2 { get; }
public uint BornTime => bornTick;
public IPlainGeometry(uint bornTime)
@@ -1,19 +1,20 @@
using StgSharp.Math;
using System;
using System.Numerics;
namespace StgSharp.Geometries
{
public class Line : IPlainGeometry
{
internal Point basePoint = new Point();
internal Point beginPoint = new Point();
internal Point endPoint = new Point();
internal Point basePoint;
internal Point beginPoint;
internal Point endPoint;
internal GetLocationHandler movBegin;
internal GetLocationHandler movEnd;
public override Point RefPoint01 => beginPoint;
public override Point RefPoint02 => endPoint;
public override Point RefPoint03 => default;
public override Point RefPoint0 => beginPoint;
public override Point RefPoint1 => endPoint;
public override Point RefPoint2 => default;
public Line(Point begin, Point end)
{
@@ -21,6 +22,12 @@ namespace StgSharp.Geometries
this.endPoint = end;
}
internal Line(Vector4 begin, Vector4 end)
{
beginPoint = new Point(begin);
endPoint = new Point(end);
}
public Line() { }
//计算线起点的方法,通过对线的派生的重写实现功能
@@ -7,15 +7,15 @@ namespace StgSharp.Geometries
{
internal Point center;
public sealed override Point RefPoint01 => center;
public sealed override Point RefPoint02 => vertex01;
public sealed override Point RefPoint03 => vertex02;
public sealed override Point RefPoint0 => center;
public sealed override Point RefPoint1 => new Point(vertexMat.mat.colum0);
public sealed override Point RefPoint2 => new Point(vertexMat.mat.colum1);
internal readonly GetLocationHandler movCenterOperation = new GetLocationHandler(GeometryOperation.DefualtMotion);
public GetLocationHandler MovCenterOperation { get { return movCenterOperation; } }
public GetLocationHandler MovVertex01Operation { get { return movVertex01Operation; } }
public GetLocationHandler MovVertex02Operation { get { return movVertex02Operation; } }
public GetLocationHandler MovVertex01Operation { get { return moveVertex0Operation; } }
public GetLocationHandler MovVertex02Operation { get { return moveVertex1Operation; } }
public virtual Vec3d MovCenter(uint tick)
{
@@ -28,7 +28,7 @@ namespace StgSharp.Geometries
/// <param name="tick">Current time tick</param>
/// <returns></returns>
/// <exception cref="UnusedVertexException">Geometry overdefined</exception>
public sealed override Vec3d MovVertex03(uint tick)
public sealed override Vec3d MoveVertex2(uint tick)
{
throw new UnusedVertexException();
}
@@ -39,7 +39,7 @@ namespace StgSharp.Geometries
/// <param name="tick">Current time tick</param>
/// <returns></returns>
/// <exception cref="UnusedVertexException">Geometry overdefined</exception>
public sealed override Vec3d MovVertex04(uint tick)
public sealed override Vec3d MoveVertex3(uint tick)
{
throw new UnusedVertexException();
}
@@ -47,10 +47,10 @@ namespace StgSharp.Geometries
internal sealed override void OnRender(uint tick)
{
uint nowTick = TimeLine.tickCounter._value;
this.vertex01.Position = RefOrigin.Position + movVertex01Operation(nowTick);
this.vertex02.Position = RefOrigin.Position + movVertex02Operation(nowTick);
this.vertex03.Position = center.Position * 2 - vertex01.Position;
this.vertex04.Position = center.Position * 2 - vertex02.Position;
this.vertexMat.Colum0 = RefOrigin.Position + moveVertex0Operation(nowTick);
this.vertexMat.Colum1 = RefOrigin.Position + moveVertex1Operation(nowTick);
this.vertexMat.Colum2 = center.Position * 2 - vertexMat.Colum0;
this.vertexMat.Colum3 = center.Position * 2 - vertexMat.Colum1;
}
}
@@ -1,4 +1,5 @@
using StgSharp.Math;
using System.Numerics;
namespace StgSharp.Geometries
{
@@ -11,6 +12,14 @@ namespace StgSharp.Geometries
internal Vec3d plainParameter;
internal readonly float d = -1;
internal Plain(Vector4 origin, Vector4 p1, Vector4 p2)
{
this.origin = new Vec3d(origin);
vec1 = new Vec3d(p1 - origin);
vec2 = new Vec3d(p2 - origin);
}
public Plain(Vec3d o, Vec3d v1, Vec3d v2)
{
this.origin = o;
@@ -1,5 +1,6 @@
using StgSharp.Math;
using System;
using System.Numerics;
using System.Runtime.InteropServices;
using System.Threading;
@@ -10,14 +11,21 @@ namespace StgSharp.Geometries
internal Vec3d position;
internal readonly bool isVertex;
public Point() { }
internal Point(Vec3d p)
{
position = p;
}
public Point()
internal Point(Vector4 vector)
{
position = new Vec3d(vector);
}
public Point(float x, float y, float z)
{
position = new Vec3d(x, y, z);
}
public Vec3d Position
@@ -5,27 +5,37 @@ namespace StgSharp.Geometries
{
public class Polygon4 : IPlainGeometry
{
internal Matrix3x4 vertexMat;
internal readonly Point vertex01;
internal readonly Point vertex02;
internal readonly Point vertex03;
internal readonly Point vertex04;
internal Point vertex0 { get; set; }
internal Point vertex1 { get; set; }
internal Point vertex2 { get; set; }
internal Point vertex3 { get; set; }
internal readonly GetLocationHandler movVertex01Operation = new GetLocationHandler(GeometryOperation.DefualtMotion);
internal readonly GetLocationHandler movVertex02Operation = new GetLocationHandler(GeometryOperation.DefualtMotion);
internal readonly GetLocationHandler movVertex03Operation = new GetLocationHandler(GeometryOperation.DefualtMotion);
internal readonly GetLocationHandler movVertex04Operation = new GetLocationHandler(GeometryOperation.DefualtMotion);
internal readonly GetLocationHandler moveVertex0Operation = new GetLocationHandler(GeometryOperation.DefualtMotion);
internal readonly GetLocationHandler moveVertex1Operation = new GetLocationHandler(GeometryOperation.DefualtMotion);
internal readonly GetLocationHandler moveVertex2Operation = new GetLocationHandler(GeometryOperation.DefualtMotion);
internal readonly GetLocationHandler moveVertex3Operation = new GetLocationHandler(GeometryOperation.DefualtMotion);
public override Point RefPoint01 => vertex01;
public override Point RefPoint0
{
get { return new Point(vertexMat.transpose.colum0); }
}
public override Point RefPoint02 => vertex02;
public override Point RefPoint1
{
get { return new Point(vertexMat.transpose.colum1); }
}
public override Point RefPoint03 => vertex03;
public override Point RefPoint2
{
get { return new Point(vertexMat.transpose.colum2); }
}
public GetLocationHandler MovVertex01Operaion { get { return movVertex01Operation; } }
public GetLocationHandler MovVertex02Operaion { get { return movVertex02Operation; } }
public GetLocationHandler MovVertex03Operaion { get { return movVertex03Operation; } }
public GetLocationHandler MovVertex04Operaion { get { return movVertex04Operation; } }
public GetLocationHandler MovVertex01Operaion { get { return moveVertex0Operation; } }
public GetLocationHandler MovVertex02Operaion { get { return moveVertex1Operation; } }
public GetLocationHandler MovVertex03Operaion { get { return moveVertex2Operation; } }
public GetLocationHandler MovVertex04Operaion { get { return moveVertex3Operation; } }
public unsafe Polygon4()
{
@@ -35,10 +45,10 @@ namespace StgSharp.Geometries
{
Line[] sides = new Line[4]
{
new Line(vertex01,vertex02),
new Line(vertex02, vertex03),
new Line(vertex03, vertex04),
new Line(vertex04, vertex01)
new Line(vertex0,vertex1),
new Line(vertex1, vertex2),
new Line(vertex2, vertex3),
new Line(vertex3, vertex0)
};
return sides;
@@ -46,26 +56,30 @@ namespace StgSharp.Geometries
public override Plain GetPlain()
{
return new Plain(this.RefPoint01, this.RefPoint02, this.RefPoint03);
vertexMat.InternalTranspose();
return new Plain(
vertexMat.mat.colum0,
vertexMat.mat.colum1,
vertexMat.mat.colum2);
}
public virtual Vec3d MovVertex01(uint tick) => movVertex01Operation.Invoke(tick);
public virtual Vec3d MoveVertex0(uint tick) => moveVertex0Operation.Invoke(tick);
public virtual Vec3d MovVertex02(uint tick) => movVertex01Operation.Invoke(tick);
public virtual Vec3d MoveVertex1(uint tick) => moveVertex1Operation.Invoke(tick);
public virtual Vec3d MovVertex03(uint tick) => movVertex01Operation.Invoke(tick);
public virtual Vec3d MoveVertex2(uint tick) => moveVertex2Operation.Invoke(tick);
public virtual Vec3d MovVertex04(uint tick) => movVertex01Operation.Invoke(tick);
public virtual Vec3d MoveVertex3(uint tick) => moveVertex3Operation.Invoke(tick);
internal override void OnRender(uint tick)
{
uint nowTick = TimeLine.tickCounter._value;
this.vertex01.Position = RefOrigin.Position + movVertex01Operation(nowTick);
this.vertex02.Position = RefOrigin.Position + movVertex02Operation(nowTick);
this.vertex03.Position = RefOrigin.Position + movVertex03Operation(nowTick);
this.vertex04.Position = RefOrigin.Position + movVertex04Operation(nowTick);
this.vertexMat.Colum0 = RefOrigin.position + moveVertex1Operation(nowTick);
this.vertexMat.Colum1 = RefOrigin.position + moveVertex1Operation(nowTick);
this.vertexMat.Colum2 = RefOrigin.position + moveVertex2Operation(nowTick);
this.vertexMat.Colum3 = RefOrigin.position + moveVertex3Operation(nowTick);
}
}
}
@@ -14,11 +14,11 @@ namespace StgSharp.Geometries
internal readonly Point vertex5;
internal readonly int _vertexCount;
public override Point RefPoint01 => vertex1;
public override Point RefPoint0 => vertex1;
public override Point RefPoint02 => vertex2;
public override Point RefPoint1 => vertex2;
public override Point RefPoint03 => vertex3;
public override Point RefPoint2 => vertex3;
internal GetLocationHandler movP01Operation = default;
internal GetLocationHandler movP02Operation = default;
@@ -14,11 +14,11 @@ namespace StgSharp.Geometries
internal Point vertex6;
internal readonly int _vertexCount;
public override Point RefPoint01 => vertex1;
public override Point RefPoint0 => vertex1;
public override Point RefPoint02 => vertex2;
public override Point RefPoint1 => vertex2;
public override Point RefPoint03 => vertex3;
public override Point RefPoint2 => vertex3;
internal GetLocationHandler movP01Operation = default;
@@ -1,4 +1,5 @@
using StgSharp.Math;
using System.Numerics;
namespace StgSharp.Geometries
{
@@ -6,11 +7,24 @@ namespace StgSharp.Geometries
{
internal Point center;
public sealed override Point RefPoint01 => center;
public sealed override Point RefPoint0 => center;
public sealed override Point RefPoint02 => vertex01;
public sealed override Point RefPoint1 => new Point(vertexMat.transpose.colum0);
public sealed override Point RefPoint03 => vertex02;
public sealed override Point RefPoint2 => new Point(vertexMat.transpose.colum1);
public Rectangle(
float v0x, float v0y, float v0z,
float v1x, float v1y, float v1z,
float v2x, float v2y, float v2z,
float v3x, float v3y, float v3z
)
{
vertexMat.mat.colum0 = new Vector4(v0x, v0y, v0z, 0);
vertexMat.mat.colum1 = new Vector4(v1x, v1y, v1z, 0);
vertexMat.mat.colum2 = new Vector4(v2x, v2y, v2z, 0);
vertexMat.mat.colum3 = new Vector4(v3x, v3y, v3z, 0);
}
@@ -21,14 +35,16 @@ namespace StgSharp.Geometries
/// <returns></returns>
public virtual Vec3d MovCenter(uint tick) => default(Vec3d);
public sealed override Vec3d MovVertex03(uint tick)
public sealed override Vec3d MoveVertex2(uint tick)
{
return this.center.Position * 2 - this.vertex01.Position;
return
new Vec3d(this.center.position.vec * 2 - vertexMat.mat.colum0);
}
public sealed override Vec3d MovVertex04(uint tick)
public sealed override Vec3d MoveVertex3(uint tick)
{
return this.center.Position * 2 - this.vertex02.Position;
return
new Vec3d(this.center.position.vec * 2 - vertexMat.mat.colum1);
}
internal sealed override void OnRender(uint tick)
@@ -1,4 +1,5 @@
using StgSharp.Math;
using System.Numerics;
namespace StgSharp.Geometries
{
@@ -8,9 +9,21 @@ namespace StgSharp.Geometries
/// </summary>
public class Square : Rectangle
{
public sealed override Vec3d MovVertex02(uint tick)
public Square(
float v0x, float v0y, float v0z,
float v1x, float v1y, float v1z,
float v2x, float v2y, float v2z,
float v3x, float v3y, float v3z)
: base(v0x, v0y, v0z,
v1x, v1y, v1z,
v2x, v2y, v2z,
v3x, v3y, v3z)
{
return this.center.Position * 2 - this.vertex01.Position;
}
public sealed override Vec3d MoveVertex1(uint tick)
{
return this.center.Position * 2 - this.vertexMat.Colum0;
}
}
@@ -1,5 +1,6 @@
using StgSharp.Controlling;
using StgSharp.Math;
using System.Numerics;
namespace StgSharp.Geometries
{
@@ -8,16 +9,15 @@ namespace StgSharp.Geometries
public unsafe class Triangle : IPlainGeometry
{
internal Point vertex1 = new Point();
internal Point vertex2 = new Point();
internal Point vertex3 = new Point();
internal Matrix3x3 vertexMap;
internal GetLocationHandler movVertex01Opearion = new GetLocationHandler(GeometryOperation.DefualtMotion);
internal GetLocationHandler movVertex02Opearion = new GetLocationHandler(GeometryOperation.DefualtMotion);
internal GetLocationHandler movVertex03Opearion = new GetLocationHandler(GeometryOperation.DefualtMotion);
public sealed override Point RefPoint01 => vertex1;
public sealed override Point RefPoint02 => vertex2;
public sealed override Point RefPoint03 => vertex3;
public sealed override Point RefPoint0 => new Point(vertexMap.mat.colum0);
public sealed override Point RefPoint1 => new Point(vertexMap.mat.colum1);
public sealed override Point RefPoint2 => new Point(vertexMap.mat.colum2);
public GetLocationHandler MovVertex01Operation => this.movVertex01Opearion;
public GetLocationHandler MovVertex02Operation => this.movVertex02Opearion;
@@ -31,18 +31,7 @@ namespace StgSharp.Geometries
public Triangle()
{
this.vertex1 = new Point();
this.vertex2 = new Point();
this.vertex3 = new Point();
/*
TimeLine._currentPool._pointContainer.Add(vertex1);
TimeLine._currentPool._pointContainer.Add(vertex2);
TimeLine._currentPool._pointContainer.Add(vertex3);
/**/
vertexMap = new Matrix3x3();
}
public Triangle(
@@ -51,26 +40,37 @@ namespace StgSharp.Geometries
Vec3d vertex03
)
{
vertex1.Position = vertex01;
vertex2.Position = vertex02;
vertex3.Position = vertex03;
vertexMap.mat.colum0 = vertex01.vec;
vertexMap.mat.colum1 = vertex02.vec;
vertexMap.mat.colum2 = vertex03.vec;
}
public Triangle(
float v0x, float v0y, float v0z,
float v1x, float v1y, float v1z,
float v2x, float v2y, float v2z
)
{
vertexMap.mat.colum0 = new Vector4(v0x, v0y, v0z, 0);
vertexMap.mat.colum1 = new Vector4(v1x, v1y, v1z, 0);
vertexMap.mat.colum2 = new Vector4(v2x, v2y, v2z, 0);
}
internal sealed override void OnRender(uint tick)
{
tick -= this.bornTick;
vertex1.Position = RefOrigin.Position + MovVertex01(tick);
vertex2.Position = RefOrigin.Position + MovVertex02(tick);
vertex3.Position = RefOrigin.Position + MovVertex03(tick);
vertexMap.mat.colum0 = RefOrigin.Position.vec + MovVertex01(tick).vec;
vertexMap.mat.colum1 = RefOrigin.Position.vec + MovVertex02(tick).vec;
vertexMap.mat.colum2 = RefOrigin.Position.vec + MovVertex03(tick).vec;
}
public override Line[] GetAllSides()
{
Line[] sides = new Line[3]
{
new Line(vertex1,vertex2),
new Line(vertex2,vertex3),
new Line(vertex3,vertex1)
new Line(vertexMap.mat.colum0,vertexMap.mat.colum1),
new Line(vertexMap.mat.colum1,vertexMap.mat.colum2),
new Line(vertexMap.mat.colum2,vertexMap.mat.colum0)
};
return sides;
@@ -78,7 +78,7 @@ namespace StgSharp.Geometries
public override Plain GetPlain()
{
return new Plain(this.vertex1, this.vertex2, this.vertex3);
return new Plain(this.vertexMap.mat.colum0, this.vertexMap.mat.colum1, this.vertexMap.mat.colum2);
}
}
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -110,7 +110,7 @@ namespace StgSharp
#if DEBUG
Console.WriteLine(name);
#endif
return (IntPtr)0b1111111111;
return internalIO.glfwGetProcAddress(name);
}
else
{
+4 -4
View File
@@ -1912,7 +1912,7 @@ namespace StgSharp
internal unsafe delegate void PFNGLDELETEBUFFERSPROC(int n, uint* buffers);
internal unsafe delegate void PFNGLGENBUFFERSPROC(int n, uint* buffers);
internal unsafe delegate bool PFNGLISBUFFERPROC(uint buffer);
internal unsafe delegate void PFNGLBUFFERDATAPROC(int target, int* size, void* data, int usage);
internal unsafe delegate void PFNGLBUFFERDATAPROC(int target, int size, void* data, int usage);
internal unsafe delegate void PFNGLBUFFERSUBDATAPROC(int target, long offset, int* size, void* data);
internal unsafe delegate void PFNGLGETBUFFERSUBDATAPROC(int target, long offset, int* size, void* data);
internal unsafe delegate void PFNGLMAPBUFFERPROC(int target, int access);
@@ -1944,9 +1944,9 @@ namespace StgSharp
internal unsafe delegate void PFNGLGETATTACHEDSHADERSPROC(uint program, int maxCount, int* count, uint* shaders);
internal unsafe delegate int PFNGLGETATTRIBLOCATIONPROC(uint program, sbyte* name);
internal unsafe delegate void PFNGLGETPROGRAMIVPROC(uint program, int pname, int* parameters);
internal unsafe delegate void PFNGLGETPROGRAMINFOLOGPROC(uint program, int bufSize, int* length, sbyte* infoLog);
internal unsafe delegate void PFNGLGETPROGRAMINFOLOGPROC(uint program, int bufSize, int* length, byte* infoLog);
internal unsafe delegate void PFNGLGETSHADERIVPROC(uint shader, int pname, int* parameters);
internal unsafe delegate void PFNGLGETSHADERINFOLOGPROC(uint shader, int bufSize, int* length, sbyte* infoLog);
internal unsafe delegate void PFNGLGETSHADERINFOLOGPROC(uint shader, int bufSize, int* length, byte* infoLog);
internal unsafe delegate void PFNGLGETSHADERSOURCEPROC(uint shader, int bufSize, int* length, sbyte* source);
internal unsafe delegate int PFNGLGETUNIFORMLOCATIONPROC(uint program, sbyte* name);
internal unsafe delegate void PFNGLGETUNIFORMFVPROC(uint program, int location, float* parameters);
@@ -1958,7 +1958,7 @@ namespace StgSharp
internal unsafe delegate bool PFNGLISPROGRAMPROC(uint program);
internal unsafe delegate bool PFNGLISSHADERPROC(uint shader);
internal unsafe delegate void PFNGLLINKPROGRAMPROC(uint program);
internal unsafe delegate void PFNGLSHADERSOURCEPROC(uint shader, int count, sbyte** str, int* length);
internal unsafe delegate void PFNGLSHADERSOURCEPROC(uint shader, int count, byte** str, int* length);
internal unsafe delegate void PFNGLUSEPROGRAMPROC(uint program);
internal unsafe delegate void PFNGLUNIFORM1FPROC(int location, float v0);
internal unsafe delegate void PFNGLUNIFORM2FPROC(int location, float v0, float v1);
+8 -35
View File
@@ -62,41 +62,14 @@ namespace StgSharp
{
throw new Exception("Do not init GLAD twice.");
}
}
/*
/// <summary>
/// Init a form, attach its data to GLFW program,
/// and return the pointer of the GLFW package of the form.
/// </summary>
/// <param name="form">The C# instance of the form</param>
/// <returns>Pointer of the GLFW package of this form</returns>
/// <exception cref="Exception">The issue that form is not successfully initilized
/// or GLAD program fail to init</exception>
public static unsafe IntPtr InitWindow(Form form)
{
IntPtr a = internalIO.InternalInitWindow(form.info);
if ((long)a == -1)
{
throw new Exception("Failed to init form.");
}
else if ((long)a == -2)
{
throw new Exception("Failed to load GLAD program.");
}
else
{
return a;
}
}
*/
}
}
@@ -1,6 +1,9 @@
namespace StgSharp.Math
using System.Numerics;
using System.Runtime.CompilerServices;
namespace StgSharp.Math
{
public unsafe static partial class Vector
public unsafe static partial class VectorCalc
{
public static Vec3d To3D(Vec2d vec)
{
@@ -26,6 +29,11 @@
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static Vec3d To3D(Vector4 vector)
{
return new Vec3d(vector);
}
}
+36 -34
View File
@@ -11,17 +11,19 @@ namespace StgSharp.Math
[FieldOffset(0)] internal Mat3 mat;
[FieldOffset(3 * 4 * sizeof(float))] internal Mat3 transpose;
[FieldOffset(6 * 4 * sizeof(float))] internal bool isTransposed;
[FieldOffset(0 * 4 * sizeof(float))] public Vec3d Colum0;
[FieldOffset(1 * 4 * sizeof(float))] public Vec3d Colum1;
[FieldOffset(2 * 4 * sizeof(float))] public Vec3d Colum2;
public Matrix3x3(
float a00,float a01,float a02,
float a10,float a11,float a12,
float a20,float a21,float a22
float a00, float a01, float a02,
float a10, float a11, float a12,
float a20, float a21, float a22
)
{
mat.colum0 = new Vector4(a00,a10,a20,0);
mat.colum1 = new Vector4(a01,a11,a21,0);
mat.colum2 = new Vector4(a02,a12,a22,0);
mat.colum0 = new Vector4(a00, a10, a20, 0);
mat.colum1 = new Vector4(a01, a11, a21, 0);
mat.colum2 = new Vector4(a02, a12, a22, 0);
}
internal Matrix3x3(
@@ -145,14 +147,14 @@ namespace StgSharp.Math
{
left.InternalTranspose();
return new Matrix3x2(
Vector4.Dot(left.transpose.colum0,right.mat.colum0),
Vector4.Dot(left.transpose.colum0,right.mat.colum1),
Vector4.Dot(left.transpose.colum0, right.mat.colum0),
Vector4.Dot(left.transpose.colum0, right.mat.colum1),
Vector4.Dot(left.transpose.colum1,right.mat.colum0),
Vector4.Dot(left.transpose.colum1,right.mat.colum1),
Vector4.Dot(left.transpose.colum1, right.mat.colum0),
Vector4.Dot(left.transpose.colum1, right.mat.colum1),
Vector4.Dot(left.transpose.colum2,right.mat.colum0),
Vector4.Dot(left.transpose.colum2,right.mat.colum1)
Vector4.Dot(left.transpose.colum2, right.mat.colum0),
Vector4.Dot(left.transpose.colum2, right.mat.colum1)
);
}
@@ -161,17 +163,17 @@ namespace StgSharp.Math
{
left.InternalTranspose();
return new Matrix3x3(
Vector4.Dot(left.transpose.colum0,right.mat.colum0),
Vector4.Dot(left.transpose.colum0,right.mat.colum1),
Vector4.Dot(left.transpose.colum0,right.mat.colum2),
Vector4.Dot(left.transpose.colum0, right.mat.colum0),
Vector4.Dot(left.transpose.colum0, right.mat.colum1),
Vector4.Dot(left.transpose.colum0, right.mat.colum2),
Vector4.Dot(left.transpose.colum1,right.mat.colum0),
Vector4.Dot(left.transpose.colum1,right.mat.colum1),
Vector4.Dot(left.transpose.colum1,right.mat.colum2),
Vector4.Dot(left.transpose.colum1, right.mat.colum0),
Vector4.Dot(left.transpose.colum1, right.mat.colum1),
Vector4.Dot(left.transpose.colum1, right.mat.colum2),
Vector4.Dot(left.transpose.colum2,right.mat.colum0),
Vector4.Dot(left.transpose.colum2,right.mat.colum1),
Vector4.Dot(left.transpose.colum2,right.mat.colum2)
Vector4.Dot(left.transpose.colum2, right.mat.colum0),
Vector4.Dot(left.transpose.colum2, right.mat.colum1),
Vector4.Dot(left.transpose.colum2, right.mat.colum2)
);
}
@@ -180,20 +182,20 @@ namespace StgSharp.Math
{
left.InternalTranspose();
return new Matrix3x4(
Vector4.Dot(left.transpose.colum0,right.mat.colum0),
Vector4.Dot(left.transpose.colum0,right.mat.colum1),
Vector4.Dot(left.transpose.colum0,right.mat.colum2),
Vector4.Dot(left.transpose.colum0,right.mat.colum3),
Vector4.Dot(left.transpose.colum0, right.mat.colum0),
Vector4.Dot(left.transpose.colum0, right.mat.colum1),
Vector4.Dot(left.transpose.colum0, right.mat.colum2),
Vector4.Dot(left.transpose.colum0, right.mat.colum3),
Vector4.Dot(left.transpose.colum1,right.mat.colum0),
Vector4.Dot(left.transpose.colum1,right.mat.colum1),
Vector4.Dot(left.transpose.colum1,right.mat.colum2),
Vector4.Dot(left.transpose.colum1,right.mat.colum3),
Vector4.Dot(left.transpose.colum1, right.mat.colum0),
Vector4.Dot(left.transpose.colum1, right.mat.colum1),
Vector4.Dot(left.transpose.colum1, right.mat.colum2),
Vector4.Dot(left.transpose.colum1, right.mat.colum3),
Vector4.Dot(left.transpose.colum2,right.mat.colum0),
Vector4.Dot(left.transpose.colum2,right.mat.colum1),
Vector4.Dot(left.transpose.colum2,right.mat.colum2),
Vector4.Dot(left.transpose.colum2,right.mat.colum3)
Vector4.Dot(left.transpose.colum2, right.mat.colum0),
Vector4.Dot(left.transpose.colum2, right.mat.colum1),
Vector4.Dot(left.transpose.colum2, right.mat.colum2),
Vector4.Dot(left.transpose.colum2, right.mat.colum3)
);
}
+10 -4
View File
@@ -1,4 +1,5 @@
using System;
using System.Drawing;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -6,13 +7,18 @@ using System.Runtime.InteropServices;
namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit, Size = 7*4*sizeof(float)+ sizeof(bool),Pack = 16)]
[StructLayout(LayoutKind.Explicit, Size = 7 * 4 * sizeof(float) + sizeof(bool), Pack = 16)]
public struct Matrix3x4
{
[FieldOffset(0)] internal Mat4 mat;
[FieldOffset(4*4*sizeof(float))] internal Mat3 transpose;
[FieldOffset(4 * 4 * sizeof(float))] internal Mat3 transpose;
[FieldOffset(7 * 4 * sizeof(float))] internal bool isTransposed;
[FieldOffset(0 * 4 * sizeof(float))] public Vec3d Colum0;
[FieldOffset(1 * 4 * sizeof(float))] public Vec3d Colum1;
[FieldOffset(2 * 4 * sizeof(float))] public Vec3d Colum2;
[FieldOffset(3 * 4 * sizeof(float))] public Vec3d Colum3;
public Matrix3x4(
float a00, float a01, float a02, float a03,
float a10, float a11, float a12, float a13,
@@ -90,8 +96,8 @@ namespace StgSharp.Math
{
if (!isTransposed)
{
fixed(Mat4* source = &this.mat)
fixed(Mat3* target = &this.transpose)
fixed (Mat4* source = &this.mat)
fixed (Mat3* target = &this.transpose)
{
internalIO.Transpose4to3_internal(source, target);
}
+9 -4
View File
@@ -6,7 +6,7 @@ using System.Runtime.InteropServices;
namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit,Size = 16,Pack = 16)]
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)]
public struct Vec3d
{
[FieldOffset(0)]
@@ -22,6 +22,11 @@ namespace StgSharp.Math
X = x; Y = y; Z = z;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal Vec3d(Vector4 vector)
{
vec = vector;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vec3d operator +(Vec3d vec1, Vec3d vec2)
@@ -57,9 +62,9 @@ namespace StgSharp.Math
public static Vec3d operator /(Vec3d vec, float value)
{
return new Vec3d(
vec.X/value,
vec.Y/value,
vec.Z/value
vec.X / value,
vec.Y / value,
vec.Z / value
);
}
@@ -60,7 +60,7 @@
平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。
</summary>
</member>
<member name="M:StgSharp.Geometries.Parallelogram.MovVertex03(System.UInt32)">
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex2(System.UInt32)">
<summary>
Move the third vertix. this is a useless method for Parallelograms.
</summary>
@@ -68,7 +68,7 @@
<returns></returns>
<exception cref="T:StgSharp.Geometries.UnusedVertexException">Geometry overdefined</exception>
</member>
<member name="M:StgSharp.Geometries.Parallelogram.MovVertex04(System.UInt32)">
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex3(System.UInt32)">
<summary>
Move the third vertix. This method is useless for Parallelograms.
</summary>
@@ -70,7 +70,7 @@
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.400\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.401\\RuntimeIdentifierGraph.json"
}
}
}
+1 -1
View File
@@ -203,7 +203,7 @@
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.400\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.401\\RuntimeIdentifierGraph.json"
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"version": 2,
"dgSpecHash": "laAh6HOqaqkeza4HK3EBhAx7AjcOlrd8Z6s26b8lsUCoYM8PIJh/NJy8SIv8UHq9F9mqp0Pw10DuCZW5/r5x5g==",
"dgSpecHash": "n9Xi4iZXV3QSFntRckZHzDXaJisY2FvKlYNQrLaVsXhG7L0GmeGCz292aaGFg24/a22cdlby5Tm2bmC2jHfvQA==",
"success": true,
"projectFilePath": "D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\源代码\\StgSharp\\StgSharp.csproj",
"expectedPackageFiles": [
@@ -60,7 +60,7 @@
平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。
</summary>
</member>
<member name="M:StgSharp.Geometries.Parallelogram.MovVertex03(System.UInt32)">
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex2(System.UInt32)">
<summary>
Move the third vertix. this is a useless method for Parallelograms.
</summary>
@@ -68,7 +68,7 @@
<returns></returns>
<exception cref="T:StgSharp.Geometries.UnusedVertexException">Geometry overdefined</exception>
</member>
<member name="M:StgSharp.Geometries.Parallelogram.MovVertex04(System.UInt32)">
<member name="M:StgSharp.Geometries.Parallelogram.MoveVertex3(System.UInt32)">
<summary>
Move the third vertix. This method is useless for Parallelograms.
</summary>
+132 -1
View File
@@ -1,9 +1,13 @@
using StgSharp.Graphics;
using StgSharp.Geometries;
using StgSharp.Graphics;
using StgSharp.Math;
using System;
using System.Diagnostics;
using System.IO;
using System.Numerics;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;
namespace StgSharp
{
@@ -25,6 +29,117 @@ namespace StgSharp
GetApiRep();
Graphic.InitGLAD(Graphic.GetProcAddress);
string vertstr = File.ReadAllText("Shader\\vertex.vert", Encoding.ASCII);
byte[] vert = Encoding.ASCII.GetBytes(vertstr + '\0');
uint vertexShader;
fixed (byte* shaderSource = vert)
{
vertexShader = internalIO.InternalLoadShaderCode(shaderSource, GLFW.GL_VERTEX_SHADER);
if (vertexShader == 0)
{
return;
}
}
string fragstr = File.ReadAllText("Shader\\fragment.frag", Encoding.ASCII);
byte[] frag = Encoding.ASCII.GetBytes(fragstr + '\0');
uint fragmentShader;
fixed (byte* shaderSource = frag)
{
fragmentShader = internalIO.InternalLoadShaderCode(shaderSource, GLFW.GL_FRAGMENT_SHADER);
if (fragmentShader == 0)
{
return;
}
}
uint shaderProgram = Graphic.glCreateProgram();
Graphic.glAttachShader(shaderProgram, vertexShader);
Graphic.glAttachShader(shaderProgram, fragmentShader);
if (internalIO.InternalLinkShaderProgram(shaderProgram) == 0)
{
IntPtr log = internalIO.InternalReadLog();
Console.WriteLine(Marshal.PtrToStringAnsi(log));
}
Graphic.glDeleteShader(vertexShader);
Graphic.glDeleteShader(fragmentShader);
Triangle tri = new Triangle(
-0.5f, -0.3f, 0.0f,
0.5f, -0.5f, 0.0f,
0.0f, 0.5f, 0.0f
);
Rectangle rec = new Rectangle(
-0.5f, 0.5f, 0.0f,
0.5f, 0.5f, 0.0f,
0.5f, -0.5f, 0.0f,
-0.5f, -0.5f, 0.0f
);
uint VAO;
Graphic.glGenVertexArrays(1, &VAO);
Graphic.glBindBuffer(GLFW.GL_ARRAY_BUFFER, VAO);
Graphic.glBindVertexArray(VAO);
/*
// for triangle rendering
uint VBO;
Graphic.glGenBuffers(1, &VBO);
Graphic.glBindBuffer(GLFW.GL_ARRAY_BUFFER, VBO);
fixed (void* data = &tri.vertexMap)
{
Graphic.glBufferData(GLFW.GL_ARRAY_BUFFER, 12 * sizeof(float), data, GLFW.GL_STATIC_DRAW);
}
Graphic.glVertexAttribPointer(0, 3, GLFW.GL_FLOAT, false, 4 * sizeof(float), (void*)0);
Graphic.glEnableVertexAttribArray(0);
/**/
/**/
// for rectangle rendering
uint VBO;
Graphic.glGenBuffers(1, &VBO);
Graphic.glBindBuffer(GLFW.GL_ARRAY_BUFFER, VBO);
fixed (void* data = &rec.vertexMat)
{
Graphic.glBufferData(GLFW.GL_ARRAY_BUFFER, 16 * sizeof(float), data, GLFW.GL_STATIC_DRAW);
}
uint[] indices = new uint[6]
{
0,1,3,
1,2,3
};
uint EBO;
Graphic.glGenBuffers(1, &EBO);
Graphic.glBindBuffer(GLFW.GL_ELEMENT_ARRAY_BUFFER, EBO);
fixed (void* data = &indices[0])
{
Graphic.glBufferData(GLFW.GL_ELEMENT_ARRAY_BUFFER, indices.Length * sizeof(uint), data, GLFW.GL_STATIC_DRAW);
}
Graphic.glVertexAttribPointer(0, 3, GLFW.GL_FLOAT, false, 4 * sizeof(float), (void*)0);
Graphic.glEnableVertexAttribArray(0);
/**/
Graphic.glBindBuffer(GLFW.GL_ARRAY_BUFFER, 0);
Graphic.glBindVertexArray(0);
while (internalIO.glfwWindowShouldClose(f.windowID) == 0)
{
ProcessInput(f.windowID);
@@ -32,10 +147,21 @@ namespace StgSharp
Graphic.glClearColor(0.2f, 0.3f, 0.3f, 1.0f);
Graphic.glClear(GLFW.GL_COLOR_BUFFER_BIT);
Graphic.glUseProgram(shaderProgram);
Graphic.glBindVertexArray(VAO);
//Graphic.glDrawArrays(GLFW.GL_TRIANGLES, 0, 3);
Graphic.glDrawElements(GLFW.GL_TRIANGLES, 6, GLFW.GL_UNSIGNED_INT, (void*)0);
Graphic.glBindVertexArray(0);
internalIO.glfwSwapBuffers(f.windowID);
internalIO.glfwPollEvents();
}
Graphic.glDeleteVertexArrays(1, &VAO);
Graphic.glDeleteBuffers(1, &VBO);
Graphic.glDeleteBuffers(1, &EBO);
internalIO.glfwTerminate();
}
@@ -69,6 +195,11 @@ namespace StgSharp
Console.WriteLine(address);
}
[DllImport(internalIO.SSGC_libname, EntryPoint = "printShaderCode",
CallingConvention = CallingConvention.Cdecl)]
internal extern unsafe static void PrintShader(byte** shadercode);
}
}
@@ -0,0 +1,6 @@
#version 330 core
out vec4 FragColor;
void main()
{
FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f);
}
@@ -0,0 +1,6 @@
#version 330 core
layout(location = 0) in vec3 aPos;
void main()
{
gl_Position = vec4(aPos.x,aPos.y,aPos.z,1.0);
}
@@ -53,6 +53,17 @@
</ItemGroup>
<ItemGroup>
<None Update="Shader\fragment.frag">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Shader\vertex.vert">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
</Target>
@@ -0,0 +1,6 @@
#version 330 core
out vec4 FragColor;
void main()
{
FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f);
}
@@ -0,0 +1,6 @@
#version 330 core
layout(location = 0) in vec3 aPos;
void main()
{
gl_Position = vec4(aPos.x,aPos.y,aPos.z,1.0);
}
@@ -0,0 +1,7 @@
#version 330 core
layout(location = 0) in vec3 aPos;
void main()
{
gl_Position = vec4(aPos.x,aPos.y,aPos.z,1.0);
}
@@ -0,0 +1,7 @@
#version 330 core
out vec4 FragColor;
void main()
{
FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f);
}
@@ -60,7 +60,7 @@
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.400\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.401\\RuntimeIdentifierGraph.json"
}
}
}
@@ -67,7 +67,7 @@
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.400\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.401\\RuntimeIdentifierGraph.json"
}
}
}
@@ -1,6 +1,6 @@
{
"version": 2,
"dgSpecHash": "mBiaYlmdKY7pcEUrgIYHWdVJNFdlkIpvBftTAU0ZhHli28Y+yj1le28eTUH+fFgrKOlwKEBtHixyqvrNNYgqaw==",
"dgSpecHash": "8o0e+XOPWIUCetvIpnINKGDtJ+TxlAo2pRPckDXb7oQQr3e4VczHCbYgbtt4FmavrHYsLJnBPvDsledArmY/bg==",
"success": true,
"projectFilePath": "D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\源代码\\StgSharpDebug\\StgSharpDebug.csproj",
"expectedPackageFiles": [],
@@ -1 +1 @@
f63f47dc6ac0f86b87f2fbb526ea68ed23d9fec7
208acf897e20abb578d5ef8df864296ff6184c25
@@ -11,3 +11,5 @@ D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharp
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpDebug\obj\x64\Debug\net6.0\refint\StgSharpDebug.dll
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpDebug\obj\x64\Debug\net6.0\StgSharpDebug.genruntimeconfig.cache
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpDebug\obj\x64\Debug\net6.0\ref\StgSharpDebug.dll
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpDebug\bin\x64\Debug\net6.0\Shader\fragment.frag
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpDebug\bin\x64\Debug\net6.0\Shader\vertex.vert
@@ -1 +1 @@
999d9ef8ee91b460e93e22f24f66316913caf649
bce6f2a08848a162fd84bd06fa09fef779ecbeb9
@@ -11,3 +11,5 @@ D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharp
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpDebug\obj\x64\Release\net6.0\refint\StgSharpDebug.dll
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpDebug\obj\x64\Release\net6.0\StgSharpDebug.genruntimeconfig.cache
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpDebug\obj\x64\Release\net6.0\ref\StgSharpDebug.dll
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpDebug\bin\x64\Release\net6.0\Shader\fragment.frag
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpDebug\bin\x64\Release\net6.0\Shader\Vertexshaer.vert
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -162,6 +162,12 @@ extern "C" {
typedef unsigned short GLhalfNV;
typedef GLintptr GLvdpauSurfaceNV;
typedef void (APIENTRY* GLVULKANPROCNV)(void);
#pragma region Const
#define GL_DEPTH_BUFFER_BIT 0x00000100
#define GL_STENCIL_BUFFER_BIT 0x00000400
#define GL_COLOR_BUFFER_BIT 0x00004000
@@ -1729,6 +1735,11 @@ extern "C" {
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10 0x93DC
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12 0x93DD
#define GL_CONTEXT_ROBUST_ACCESS 0x90F3
#pragma endregion
#ifndef GL_VERSION_1_0
#define GL_VERSION_1_0 1
GLAPI int GLAD_GL_VERSION_1_0;
@@ -8,6 +8,12 @@
#include <stdio.h>
#include "StgSharpGraphic.h"
extern char* infolog[512] = { 0 };
void printShaderCode(char* const* code)
{
printf(*code);
}
SSGC_API void initGL(int majorVersion, int minorVersion)
{
@@ -26,3 +32,47 @@ SSGC_API int initGLAD(void)
{
return gladLoadGLLoader((GLADloadproc)glfwGetProcAddress);
}
SSGC_API unsigned int loadShaderCode(char* const shaderCode, GLint shadertype)
{
unsigned int shader = glCreateShader(shadertype);
glShaderSource(shader, 1, &shaderCode, NULL);
glCompileShader(shader);
int success;
glGetShaderiv(shader, GL_COMPILE_STATUS, &success);
if (!success)
{
glGetShaderInfoLog(shader, 512, NULL, infolog);
infolog[511] = '\0';
printf(infolog);
return 0;
}
else
{
return shader;
}
}
SSGC_API unsigned int linkShaderProgram(GLuint shaderProgram)
{
glLinkProgram(shaderProgram);
int success;
glGetProgramiv(shaderProgram, GL_LINK_STATUS, &success);
if (!success)
{
glGetProgramInfoLog(shaderProgram, 512, NULL, infolog);
printf(infolog);
return 0;
}
else
{
return shaderProgram;
}
}
char* _cdecl readLog()
{
return infolog[0];
}
+5 -14
View File
@@ -16,9 +16,7 @@
#pragma region debug
SSGC_API void getApiReporter(uint64_t reporterAddress);
SSGC_API void printShaderCode(char* const* code);
#pragma endregion
@@ -37,15 +35,15 @@ SSGC_API _inline float __cdecl mulps_total_internal(__m128 vec);
#pragma endregion
SSGC_API char* infolog[512];
SSGC_API void _cdecl initGL(int majorVersion, int minorVersion);
SSGC_API int _cdecl initGLAD(void);
SSGC_API unsigned int _cdecl loadShaderCode(char* const shaderCode, GLint shadertype);
SSGC_API unsigned int _cdecl linkShaderProgram(GLuint shadertype);
SSGC_API char* _cdecl readLog();
//linear related function
@@ -84,9 +82,6 @@ typedef struct matrix4 {
#pragma endregion
#pragma region mat2
@@ -97,7 +92,6 @@ SSGC_API _inline void __cdecl deinit_mat2(matrix2map* mat);
#pragma endregion
#pragma region mat3
@@ -110,9 +104,6 @@ SSGC_API __inline float det_mat3_internal(__m128 const c1, __m128 const c2, __m1
#pragma endregion
#pragma region mat4
//type and function for 4 colum matrix
@@ -1,322 +0,0 @@
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.36.32537.0
include listing.inc
INCLUDELIB MSVCRT
INCLUDELIB OLDNAMES
_DATA SEGMENT
COMM pack:BYTE:038H
_DATA ENDS
msvcjmc SEGMENT
__0998321F_concurrencysal@h DB 01H
__E9680BEC_sal@h DB 01H
__75F3BDA1_vadefs@h DB 01H
__FF647DA5_vcruntime@h DB 01H
__0DFED3C7_stdint@h DB 01H
__018B5678_khrplatform@h DB 01H
__79FC18F0_glad@h DB 01H
__04C75F1C_corecrt@h DB 01H
__0C5B3DCC_stddef@h DB 01H
__986CAB3E_glfw3@h DB 01H
__3347223C_winpackagefamily@h DB 01H
__F5B671E4_winapifamily@h DB 01H
__6866F092_sdkddkver@h DB 01H
__B11E23B5_excpt@h DB 01H
__39216D08_stdarg@h DB 01H
__4114BAD5_specstrings_undef@h DB 01H
__50F9AEDC_specstrings_strict@h DB 01H
__BEFC0098_sdv_driverspecs@h DB 01H
__39A39701_driverspecs@h DB 01H
__B4D8BDAA_specstrings@h DB 01H
__78D0C915_corecrt_wctype@h DB 01H
__6AECDA3E_ctype@h DB 01H
__B6CCE7CD_kernelspecs@h DB 01H
__201B1099_basetsd@h DB 01H
__15E49872_errno@h DB 01H
__C2713F5C_vcruntime_string@h DB 01H
__184F7456_corecrt_memcpy_s@h DB 01H
__82377222_corecrt_memory@h DB 01H
__5B29309E_corecrt_wstring@h DB 01H
__F787F5CD_string@h DB 01H
__8C99318D_guiddef@h DB 01H
__A3CAA675_pshpack4@h DB 01H
__2611E9B9_poppack@h DB 01H
__A747DAC7_pshpack2@h DB 01H
__AAD05F11_pshpack8@h DB 01H
__A501649E_pshpack1@h DB 01H
__0E9D9C0E_apiset@h DB 01H
__F9851A06_ktmtypes@h DB 01H
__9DA2B69E_winnt@h DB 01H
__E9AED855_minwindef@h DB 01H
__9668718B_windef@h DB 01H
__B47C9622_apisetcconv@h DB 01H
__77F4CE3E_minwinbase@h DB 01H
__42CF8FD5_apiquery2@h DB 01H
__A6C51434_processenv@h DB 01H
__415D7145_fileapi@h DB 01H
__A7316A9B_fileapifromapp@h DB 01H
__A0359A2D_debugapi@h DB 01H
__28BE1226_utilapiset@h DB 01H
__6933B394_handleapi@h DB 01H
__57F09DF9_errhandlingapi@h DB 01H
__E0622DF9_fibersapi@h DB 01H
__D531F6AB_namedpipeapi@h DB 01H
__ADD82BB4_profileapi@h DB 01H
__ECFC4D70_heapapi@h DB 01H
__4F41815B_ioapiset@h DB 01H
__8D44BFB7_synchapi@h DB 01H
__8CAEC090_interlockedapi@h DB 01H
__8ABF54F4_processthreadsapi@h DB 01H
__1462A586_sysinfoapi@h DB 01H
__369DBA4C_memoryapi@h DB 01H
__02D65571_enclaveapi@h DB 01H
__50387E19_threadpoollegacyapiset@h DB 01H
__C40195AA_threadpoolapiset@h DB 01H
__792B5764_jobapi@h DB 01H
__BAD0D5EB_jobapi2@h DB 01H
__C6FE0B21_wow64apiset@h DB 01H
__94EE79C1_libloaderapi@h DB 01H
__E203BDE6_securitybaseapi@h DB 01H
__9590F1DC_namespaceapi@h DB 01H
__0F4602F6_systemtopologyapi@h DB 01H
__B1B3B677_processtopologyapi@h DB 01H
__7DD200C2_securityappcontainer@h DB 01H
__130664A2_realtimeapiset@h DB 01H
__A8C6672F_winerror@h DB 01H
__A093DD28_timezoneapi@h DB 01H
__6BD3506C_winbase@h DB 01H
__DABCB3B7_wingdi@h DB 01H
__CD8F5E54_tvout@h DB 01H
__033B1B1B_winuser@h DB 01H
__F8663FCA_datetimeapi@h DB 01H
__03A9DF8F_winnls@h DB 01H
__CB7A78CC_stringapiset@h DB 01H
__3F149E59_wincontypes@h DB 01H
__7CC6F8F3_consoleapi@h DB 01H
__D4BE3EA3_consoleapi2@h DB 01H
__D57C5494_consoleapi3@h DB 01H
__FD7284F3_wincon@h DB 01H
__2EBE7A74_verrsrc@h DB 01H
__2FF32671_winver@h DB 01H
__E384C5B4_reason@h DB 01H
__C09EE12A_winreg@h DB 01H
__F1A080AC_wnnc@h DB 01H
__C375DB87_winnetwk@h DB 01H
__DD9DD587_stralign@h DB 01H
__B85B9837_winsvc@h DB 01H
__12FBC1E4_mcx@h DB 01H
__BC6D10F5_ime_cmodes@h DB 01H
__1D49718C_imm@h DB 01H
__95734585_windows@h DB 01H
__F7492337_framework@h DB 01H
__9BEA891A_mmintrin@h DB 01H
__494656A0_corecrt_malloc@h DB 01H
__E5D9469F_malloc@h DB 01H
__7FB111F1_xmmintrin@h DB 01H
__1AD3983D_emmintrin@h DB 01H
__C572F0B4_pmmintrin@h DB 01H
__75AB8336_tmmintrin@h DB 01H
__5C9096B5_smmintrin@h DB 01H
__39F21F79_nmmintrin@h DB 01H
__EC49E537_wmmintrin@h DB 01H
__27DDA830_zmmintrin@h DB 01H
__10C90AFA_immintrin@h DB 01H
__C508448F_StgSharpGraphic@h DB 01H
__52DA9D07_StgSharpGraphic@c DB 01H
msvcjmc ENDS
PUBLIC loadGLApi
PUBLIC initGL
PUBLIC initGLAD
PUBLIC __JustMyCode_Default
EXTRN gladLoadGLLoader:PROC
EXTRN glfwInit:PROC
EXTRN glfwWindowHint:PROC
EXTRN glfwCreateWindow:PROC
EXTRN glfwWindowShouldClose:PROC
EXTRN glfwSetFramebufferSizeCallback:PROC
EXTRN glfwMakeContextCurrent:PROC
EXTRN glfwSwapBuffers:PROC
EXTRN glfwSwapInterval:PROC
EXTRN glfwGetProcAddress:PROC
EXTRN __CheckForDebuggerJustMyCode:PROC
EXTRN glad_glClearColor:QWORD
; COMDAT pdata
pdata SEGMENT
$pdata$loadGLApi DD imagerel $LN4
DD imagerel $LN4+173
DD imagerel $unwind$loadGLApi
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$initGL DD imagerel $LN4
DD imagerel $LN4+70
DD imagerel $unwind$initGL
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$initGLAD DD imagerel $LN4
DD imagerel $LN4+32
DD imagerel $unwind$initGLAD
pdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$initGLAD DD 010401H
DD 04204H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$initGL DD 010401H
DD 04204H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$loadGLApi DD 020601H
DD 030023206H
xdata ENDS
; Function compile flags: /Odt
; COMDAT __JustMyCode_Default
_TEXT SEGMENT
__JustMyCode_Default PROC ; COMDAT
00000 c2 00 00 ret 0
__JustMyCode_Default ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\StgSharpGraphic.c
; COMDAT initGLAD
_TEXT SEGMENT
initGLAD PROC ; COMDAT
; 45 : {
$LN4:
00000 48 83 ec 28 sub rsp, 40 ; 00000028H
00004 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__52DA9D07_StgSharpGraphic@c
0000b e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00010 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:glfwGetProcAddress
; 46 : return gladLoadGLLoader((GLADloadproc)glfwGetProcAddress);
; 47 : }
00017 48 83 c4 28 add rsp, 40 ; 00000028H
0001b e9 00 00 00 00 jmp gladLoadGLLoader
initGLAD ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\StgSharpGraphic.c
; COMDAT initGL
_TEXT SEGMENT
initGL PROC ; COMDAT
; 32 : {
$LN4:
00000 48 83 ec 28 sub rsp, 40 ; 00000028H
00004 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__52DA9D07_StgSharpGraphic@c
0000b e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00010 e8 00 00 00 00 call glfwInit
00015 ba 03 00 00 00 mov edx, 3
0001a b9 02 20 02 00 mov ecx, 139266 ; 00022002H
0001f e8 00 00 00 00 call glfwWindowHint
00024 ba 03 00 00 00 mov edx, 3
00029 b9 03 20 02 00 mov ecx, 139267 ; 00022003H
0002e e8 00 00 00 00 call glfwWindowHint
00033 ba 01 20 03 00 mov edx, 204801 ; 00032001H
00038 b9 08 20 02 00 mov ecx, 139272 ; 00022008H
; 33 : glfwInit();
; 34 : glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
; 35 : glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
; 36 : glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
; 37 :
; 38 : #ifdef __APPLE__
; 39 : glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
; 40 : #endif // __APPLE__
; 41 : }
0003d 48 83 c4 28 add rsp, 40 ; 00000028H
00041 e9 00 00 00 00 jmp glfwWindowHint
initGL ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\StgSharpGraphic.c
; COMDAT loadGLApi
_TEXT SEGMENT
__$ReturnAddress$ = 48
loadGLApi PROC ; COMDAT
; 15 : {
$LN4:
00000 40 53 push rbx
00002 48 83 ec 20 sub rsp, 32 ; 00000020H
00006 48 8b d9 mov rbx, rcx
00009 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__52DA9D07_StgSharpGraphic@c
00010 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00015 48 8d 05 00 00
00 00 lea rax, OFFSET FLAT:glfwCreateWindow
0001c 48 89 05 00 00
00 00 mov QWORD PTR pack, rax
00023 48 8d 05 00 00
00 00 lea rax, OFFSET FLAT:glfwMakeContextCurrent
0002a 48 89 05 08 00
00 00 mov QWORD PTR pack+8, rax
00031 48 8d 05 00 00
00 00 lea rax, OFFSET FLAT:glfwSwapInterval
00038 0f 10 05 00 00
00 00 movups xmm0, XMMWORD PTR pack
0003f 48 89 05 10 00
00 00 mov QWORD PTR pack+16, rax
00046 48 8b 05 00 00
00 00 mov rax, QWORD PTR glad_glClearColor
0004d 48 89 05 18 00
00 00 mov QWORD PTR pack+24, rax
00054 48 8d 05 00 00
00 00 lea rax, OFFSET FLAT:glfwWindowShouldClose
0005b 0f 10 0d 10 00
00 00 movups xmm1, XMMWORD PTR pack+16
00062 48 89 05 20 00
00 00 mov QWORD PTR pack+32, rax
00069 48 8d 05 00 00
00 00 lea rax, OFFSET FLAT:glfwSwapBuffers
00070 0f 11 03 movups XMMWORD PTR [rbx], xmm0
00073 48 89 05 28 00
00 00 mov QWORD PTR pack+40, rax
0007a 48 8d 05 00 00
00 00 lea rax, OFFSET FLAT:glfwSetFramebufferSizeCallback
00081 0f 10 05 20 00
00 00 movups xmm0, XMMWORD PTR pack+32
00088 48 89 05 30 00
00 00 mov QWORD PTR pack+48, rax
0008f 48 8b c3 mov rax, rbx
00092 0f 11 4b 10 movups XMMWORD PTR [rbx+16], xmm1
00096 f2 0f 10 0d 30
00 00 00 movsd xmm1, QWORD PTR pack+48
0009e 0f 11 43 20 movups XMMWORD PTR [rbx+32], xmm0
000a2 f2 0f 11 4b 30 movsd QWORD PTR [rbx+48], xmm1
; 16 :
; 17 : pack.createWindow = glfwCreateWindow;
; 18 : pack.makeContextCurrent = glfwMakeContextCurrent;
; 19 : pack.swapInterval = glfwSwapInterval;
; 20 : pack.clearColor = glClearColor;
; 21 : pack.windowShouldClose = glfwWindowShouldClose;
; 22 : pack.swapBuffer = glfwSwapBuffers;
; 23 :
; 24 : //these are for callback
; 25 : pack.SetFramebufferSizeCallback = glfwSetFramebufferSizeCallback;
; 26 :
; 27 :
; 28 : return pack;
; 29 : }
000a7 48 83 c4 20 add rsp, 32 ; 00000020H
000ab 5b pop rbx
000ac c3 ret 0
loadGLApi ENDP
_TEXT ENDS
END
@@ -1,221 +0,0 @@
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.36.32537.0
include listing.inc
INCLUDELIB MSVCRT
INCLUDELIB OLDNAMES
PUBLIC defaultVecPtr
_BSS SEGMENT
defaultVecPtr DQ 01H DUP (?)
_BSS ENDS
_DATA SEGMENT
COMM pack:BYTE:038H
_DATA ENDS
msvcjmc SEGMENT
__3347223C_winpackagefamily@h DB 01H
__F5B671E4_winapifamily@h DB 01H
__6866F092_sdkddkver@h DB 01H
__0998321F_concurrencysal@h DB 01H
__E9680BEC_sal@h DB 01H
__75F3BDA1_vadefs@h DB 01H
__FF647DA5_vcruntime@h DB 01H
__B11E23B5_excpt@h DB 01H
__39216D08_stdarg@h DB 01H
__4114BAD5_specstrings_undef@h DB 01H
__50F9AEDC_specstrings_strict@h DB 01H
__BEFC0098_sdv_driverspecs@h DB 01H
__39A39701_driverspecs@h DB 01H
__B4D8BDAA_specstrings@h DB 01H
__04C75F1C_corecrt@h DB 01H
__78D0C915_corecrt_wctype@h DB 01H
__6AECDA3E_ctype@h DB 01H
__B6CCE7CD_kernelspecs@h DB 01H
__201B1099_basetsd@h DB 01H
__15E49872_errno@h DB 01H
__C2713F5C_vcruntime_string@h DB 01H
__184F7456_corecrt_memcpy_s@h DB 01H
__82377222_corecrt_memory@h DB 01H
__5B29309E_corecrt_wstring@h DB 01H
__F787F5CD_string@h DB 01H
__8C99318D_guiddef@h DB 01H
__A3CAA675_pshpack4@h DB 01H
__2611E9B9_poppack@h DB 01H
__A747DAC7_pshpack2@h DB 01H
__AAD05F11_pshpack8@h DB 01H
__A501649E_pshpack1@h DB 01H
__0E9D9C0E_apiset@h DB 01H
__F9851A06_ktmtypes@h DB 01H
__9DA2B69E_winnt@h DB 01H
__E9AED855_minwindef@h DB 01H
__9668718B_windef@h DB 01H
__B47C9622_apisetcconv@h DB 01H
__77F4CE3E_minwinbase@h DB 01H
__42CF8FD5_apiquery2@h DB 01H
__A6C51434_processenv@h DB 01H
__415D7145_fileapi@h DB 01H
__A7316A9B_fileapifromapp@h DB 01H
__A0359A2D_debugapi@h DB 01H
__28BE1226_utilapiset@h DB 01H
__6933B394_handleapi@h DB 01H
__57F09DF9_errhandlingapi@h DB 01H
__E0622DF9_fibersapi@h DB 01H
__D531F6AB_namedpipeapi@h DB 01H
__ADD82BB4_profileapi@h DB 01H
__ECFC4D70_heapapi@h DB 01H
__4F41815B_ioapiset@h DB 01H
__8D44BFB7_synchapi@h DB 01H
__8CAEC090_interlockedapi@h DB 01H
__8ABF54F4_processthreadsapi@h DB 01H
__1462A586_sysinfoapi@h DB 01H
__369DBA4C_memoryapi@h DB 01H
__02D65571_enclaveapi@h DB 01H
__50387E19_threadpoollegacyapiset@h DB 01H
__C40195AA_threadpoolapiset@h DB 01H
__792B5764_jobapi@h DB 01H
__BAD0D5EB_jobapi2@h DB 01H
__C6FE0B21_wow64apiset@h DB 01H
__94EE79C1_libloaderapi@h DB 01H
__E203BDE6_securitybaseapi@h DB 01H
__9590F1DC_namespaceapi@h DB 01H
__0F4602F6_systemtopologyapi@h DB 01H
__B1B3B677_processtopologyapi@h DB 01H
__7DD200C2_securityappcontainer@h DB 01H
__130664A2_realtimeapiset@h DB 01H
__A8C6672F_winerror@h DB 01H
__A093DD28_timezoneapi@h DB 01H
__6BD3506C_winbase@h DB 01H
__DABCB3B7_wingdi@h DB 01H
__CD8F5E54_tvout@h DB 01H
__033B1B1B_winuser@h DB 01H
__F8663FCA_datetimeapi@h DB 01H
__03A9DF8F_winnls@h DB 01H
__CB7A78CC_stringapiset@h DB 01H
__3F149E59_wincontypes@h DB 01H
__7CC6F8F3_consoleapi@h DB 01H
__D4BE3EA3_consoleapi2@h DB 01H
__D57C5494_consoleapi3@h DB 01H
__FD7284F3_wincon@h DB 01H
__2EBE7A74_verrsrc@h DB 01H
__2FF32671_winver@h DB 01H
__E384C5B4_reason@h DB 01H
__C09EE12A_winreg@h DB 01H
__F1A080AC_wnnc@h DB 01H
__C375DB87_winnetwk@h DB 01H
__DD9DD587_stralign@h DB 01H
__B85B9837_winsvc@h DB 01H
__12FBC1E4_mcx@h DB 01H
__BC6D10F5_ime_cmodes@h DB 01H
__1D49718C_imm@h DB 01H
__95734585_windows@h DB 01H
__F7492337_framework@h DB 01H
__0DFED3C7_stdint@h DB 01H
__018B5678_khrplatform@h DB 01H
__79FC18F0_glad@h DB 01H
__0C5B3DCC_stddef@h DB 01H
__986CAB3E_glfw3@h DB 01H
__9BEA891A_mmintrin@h DB 01H
__494656A0_corecrt_malloc@h DB 01H
__E5D9469F_malloc@h DB 01H
__7FB111F1_xmmintrin@h DB 01H
__1AD3983D_emmintrin@h DB 01H
__C572F0B4_pmmintrin@h DB 01H
__75AB8336_tmmintrin@h DB 01H
__5C9096B5_smmintrin@h DB 01H
__39F21F79_nmmintrin@h DB 01H
__EC49E537_wmmintrin@h DB 01H
__27DDA830_zmmintrin@h DB 01H
__10C90AFA_immintrin@h DB 01H
__C508448F_StgSharpGraphic@h DB 01H
__BA7172FA_dllmain@c DB 01H
msvcjmc ENDS
PUBLIC DllMain
PUBLIC __JustMyCode_Default
EXTRN __imp__aligned_malloc:PROC
EXTRN __CheckForDebuggerJustMyCode:PROC
; COMDAT pdata
pdata SEGMENT
$pdata$DllMain DD imagerel $LN24
DD imagerel $LN24+68
DD imagerel $unwind$DllMain
pdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$DllMain DD 020601H
DD 030023206H
xdata ENDS
; Function compile flags: /Odt
; COMDAT __JustMyCode_Default
_TEXT SEGMENT
__JustMyCode_Default PROC ; COMDAT
00000 c2 00 00 ret 0
__JustMyCode_Default ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\dllmain.c
; COMDAT DllMain
_TEXT SEGMENT
hModule$ = 48
ul_reason_for_call$ = 56
lpReserved$ = 64
DllMain PROC ; COMDAT
; 17 : {
$LN24:
00000 40 53 push rbx
00002 48 83 ec 20 sub rsp, 32 ; 00000020H
00006 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__BA7172FA_dllmain@c
0000d 8b da mov ebx, edx
0000f e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00014 83 fb 01 cmp ebx, 1
00017 75 20 jne SHORT $LN20@DllMain
00019 0f 1f 80 00 00
00 00 npad 7
$LL6@DllMain:
; 18 : switch (ul_reason_for_call)
; 19 : {
; 20 : case DLL_PROCESS_ATTACH:
; 21 : do
; 22 : {
; 23 : defaultVecPtr = _aligned_malloc(sizeof(__m128),16);
00020 ba 10 00 00 00 mov edx, 16
00025 8b ca mov ecx, edx
00027 ff 15 00 00 00
00 call QWORD PTR __imp__aligned_malloc
0002d 48 89 05 00 00
00 00 mov QWORD PTR defaultVecPtr, rax
; 24 : } while (defaultVecPtr == NULL);
00034 48 85 c0 test rax, rax
00037 74 e7 je SHORT $LL6@DllMain
$LN20@DllMain:
; 25 :
; 26 :
; 27 : case DLL_THREAD_ATTACH:
; 28 :
; 29 :
; 30 : case DLL_THREAD_DETACH:
; 31 :
; 32 :
; 33 : case DLL_PROCESS_DETACH:
; 34 :
; 35 :
; 36 :
; 37 : break;
; 38 : }
; 39 : return TRUE;
; 40 : }
00039 b8 01 00 00 00 mov eax, 1
0003e 48 83 c4 20 add rsp, 32 ; 00000020H
00042 5b pop rbx
00043 c3 ret 0
DllMain ENDP
_TEXT ENDS
END
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
@@ -1,961 +0,0 @@
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.36.32537.0
include listing.inc
INCLUDELIB MSVCRT
INCLUDELIB OLDNAMES
_DATA SEGMENT
COMM pack:BYTE:038H
_DATA ENDS
msvcjmc SEGMENT
__0998321F_concurrencysal@h DB 01H
__E9680BEC_sal@h DB 01H
__75F3BDA1_vadefs@h DB 01H
__FF647DA5_vcruntime@h DB 01H
__0DFED3C7_stdint@h DB 01H
__018B5678_khrplatform@h DB 01H
__79FC18F0_glad@h DB 01H
__04C75F1C_corecrt@h DB 01H
__0C5B3DCC_stddef@h DB 01H
__986CAB3E_glfw3@h DB 01H
__9BEA891A_mmintrin@h DB 01H
__494656A0_corecrt_malloc@h DB 01H
__E5D9469F_malloc@h DB 01H
__7FB111F1_xmmintrin@h DB 01H
__1AD3983D_emmintrin@h DB 01H
__C572F0B4_pmmintrin@h DB 01H
__75AB8336_tmmintrin@h DB 01H
__5C9096B5_smmintrin@h DB 01H
__39F21F79_nmmintrin@h DB 01H
__EC49E537_wmmintrin@h DB 01H
__27DDA830_zmmintrin@h DB 01H
__10C90AFA_immintrin@h DB 01H
__C508448F_StgSharpGraphic@h DB 01H
__C44F8F6B_corecrt_stdio_config@h DB 01H
__A7F89B2B_corecrt_wstdio@h DB 01H
__B5C48800_stdio@h DB 01H
__62BFBAF5_stdalign@h DB 01H
__B5461FF6_linear@c DB 01H
msvcjmc ENDS
PUBLIC mulps_sum_internal
PUBLIC mulps_total_internal
PUBLIC load
PUBLIC load_cpy
PUBLIC addps
PUBLIC subps
PUBLIC mulps_const
PUBLIC mulps
PUBLIC mulps_sum
PUBLIC divps_const
PUBLIC divps
PUBLIC sqrtss_const
PUBLIC set_m128ptr_default
PUBLIC deinitM128
PUBLIC load_matmap
PUBLIC __JustMyCode_Default
EXTRN __imp__aligned_free:PROC
EXTRN __imp__aligned_malloc:PROC
EXTRN __CheckForDebuggerJustMyCode:PROC
EXTRN __GSHandlerCheck:PROC
EXTRN __security_check_cookie:PROC
EXTRN defaultVecPtr:QWORD
EXTRN __security_cookie:QWORD
EXTRN _fltused:DWORD
; COMDAT pdata
pdata SEGMENT
$pdata$mulps_sum_internal DD imagerel $LN4
DD imagerel $LN4+53
DD imagerel $unwind$mulps_sum_internal
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$load DD imagerel $LN7
DD imagerel $LN7+140
DD imagerel $unwind$load
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$load_cpy DD imagerel $LN7
DD imagerel $LN7+52
DD imagerel $unwind$load_cpy
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$addps DD imagerel $LN7
DD imagerel $LN7+85
DD imagerel $unwind$addps
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$subps DD imagerel $LN7
DD imagerel $LN7+85
DD imagerel $unwind$subps
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$mulps_const DD imagerel $LN7
DD imagerel $LN7+94
DD imagerel $unwind$mulps_const
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$mulps DD imagerel $LN7
DD imagerel $LN7+84
DD imagerel $unwind$mulps
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$mulps_sum DD imagerel $LN4
DD imagerel $LN4+53
DD imagerel $unwind$mulps_sum
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$divps_const DD imagerel $LN7
DD imagerel $LN7+97
DD imagerel $unwind$divps_const
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$divps DD imagerel $LN7
DD imagerel $LN7+84
DD imagerel $unwind$divps
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$sqrtss_const DD imagerel $LN4
DD imagerel $LN4+47
DD imagerel $unwind$sqrtss_const
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$set_m128ptr_default DD imagerel $LN4
DD imagerel $LN4+28
DD imagerel $unwind$set_m128ptr_default
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$deinitM128 DD imagerel $LN4
DD imagerel $LN4+36
DD imagerel $unwind$deinitM128
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$load_matmap DD imagerel $LN7
DD imagerel $LN7+146
DD imagerel $unwind$load_matmap
pdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$load_matmap DD 082419H
DD 0e7415H
DD 0d6415H
DD 0c3415H
DD 0e0119215H
DD imagerel __GSHandlerCheck
DD 040H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$deinitM128 DD 020601H
DD 030023206H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$set_m128ptr_default DD 010401H
DD 04204H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$sqrtss_const DD 030901H
DD 026809H
DD 06204H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$divps DD 040a01H
DD 06340aH
DD 07006320aH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$divps_const DD 040b01H
DD 03680bH
DD 030027206H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$mulps_sum DD 040a01H
DD 06340aH
DD 07006320aH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$mulps DD 040a01H
DD 06340aH
DD 07006320aH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$mulps_const DD 040b01H
DD 03680bH
DD 030027206H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$subps DD 040a01H
DD 06340aH
DD 07006320aH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$addps DD 040a01H
DD 06340aH
DD 07006320aH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$load_cpy DD 020601H
DD 030023206H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$load DD 092701H
DD 039827H
DD 04881eH
DD 057815H
DD 066809H
DD 0e204H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$mulps_sum_internal DD 040a01H
DD 06340aH
DD 07006320aH
xdata ENDS
; Function compile flags: /Odt
; COMDAT __JustMyCode_Default
_TEXT SEGMENT
__JustMyCode_Default PROC ; COMDAT
00000 c2 00 00 ret 0
__JustMyCode_Default ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\linear.c
; COMDAT load_matmap
_TEXT SEGMENT
ptr$ = 32
__$ArrayPad$ = 64
c0$ = 96
c1$ = 104
c2$ = 112
c3$ = 120
load_matmap PROC ; COMDAT
; 182 : {
$LN7:
00000 48 89 5c 24 08 mov QWORD PTR [rsp+8], rbx
00005 48 89 74 24 10 mov QWORD PTR [rsp+16], rsi
0000a 48 89 7c 24 18 mov QWORD PTR [rsp+24], rdi
0000f 41 56 push r14
00011 48 83 ec 50 sub rsp, 80 ; 00000050H
00015 48 8b 05 00 00
00 00 mov rax, QWORD PTR __security_cookie
0001c 48 33 c4 xor rax, rsp
0001f 48 89 44 24 40 mov QWORD PTR __$ArrayPad$[rsp], rax
00024 48 8b d9 mov rbx, rcx
00027 4d 8b f1 mov r14, r9
0002a 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__B5461FF6_linear@c
00031 49 8b f0 mov rsi, r8
00034 48 8b fa mov rdi, rdx
00037 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
0003c ba 20 00 00 00 mov edx, 32 ; 00000020H
00041 8b ca mov ecx, edx
00043 ff 15 00 00 00
00 call QWORD PTR __imp__aligned_malloc
00049 48 89 5c 24 20 mov QWORD PTR ptr$[rsp], rbx
0004e 48 89 7c 24 28 mov QWORD PTR ptr$[rsp+8], rdi
00053 48 89 74 24 30 mov QWORD PTR ptr$[rsp+16], rsi
00058 4c 89 74 24 38 mov QWORD PTR ptr$[rsp+24], r14
0005d 48 85 c0 test rax, rax
00060 74 0d je SHORT $LN4@load_matma
; 183 : __m256i* retPtr = _aligned_malloc(sizeof(__m256i), sizeof(__m256i));
; 184 :
; 185 : uint64_t ptr[4] = {c0,c1,c2,c3 };
; 186 :
; 187 : if (NULL != retPtr)
; 188 : {
; 189 : *retPtr = _mm256_loadu_epi64(&ptr);
00062 c5 fe 6f 44 24
20 vmovdqu ymm0, YMMWORD PTR ptr$[rsp]
00068 c5 fe 7f 00 vmovdqu YMMWORD PTR [rax], ymm0
0006c c5 f8 77 vzeroupper
$LN4@load_matma:
; 190 : }
; 191 :
; 192 : return retPtr;
; 193 :
; 194 : }
0006f 48 8b 4c 24 40 mov rcx, QWORD PTR __$ArrayPad$[rsp]
00074 48 33 cc xor rcx, rsp
00077 e8 00 00 00 00 call __security_check_cookie
0007c 48 8b 5c 24 60 mov rbx, QWORD PTR [rsp+96]
00081 48 8b 74 24 68 mov rsi, QWORD PTR [rsp+104]
00086 48 8b 7c 24 70 mov rdi, QWORD PTR [rsp+112]
0008b 48 83 c4 50 add rsp, 80 ; 00000050H
0008f 41 5e pop r14
00091 c3 ret 0
load_matmap ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\linear.c
; COMDAT deinitM128
_TEXT SEGMENT
ptr$ = 48
deinitM128 PROC ; COMDAT
; 212 : {
$LN4:
00000 40 53 push rbx
00002 48 83 ec 20 sub rsp, 32 ; 00000020H
00006 48 8b d9 mov rbx, rcx
00009 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__B5461FF6_linear@c
00010 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00015 48 8b cb mov rcx, rbx
; 213 : _aligned_free(ptr);
; 214 : }
00018 48 83 c4 20 add rsp, 32 ; 00000020H
0001c 5b pop rbx
0001d 48 ff 25 00 00
00 00 rex_jmp QWORD PTR __imp__aligned_free
deinitM128 ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\linear.c
; COMDAT set_m128ptr_default
_TEXT SEGMENT
set_m128ptr_default PROC ; COMDAT
; 199 : {
$LN4:
00000 48 83 ec 28 sub rsp, 40 ; 00000028H
00004 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__B5461FF6_linear@c
0000b e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00010 48 8b 05 00 00
00 00 mov rax, QWORD PTR defaultVecPtr
; 200 : return defaultVecPtr;
; 201 : }
00017 48 83 c4 28 add rsp, 40 ; 00000028H
0001b c3 ret 0
set_m128ptr_default ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\linear.c
; COMDAT sqrtss_const
_TEXT SEGMENT
a$ = 64
sqrtss_const PROC ; COMDAT
; 169 : {
$LN4:
00000 48 83 ec 38 sub rsp, 56 ; 00000038H
00004 0f 29 74 24 20 movaps XMMWORD PTR [rsp+32], xmm6
00009 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__B5461FF6_linear@c
00010 0f 28 f0 movaps xmm6, xmm0
00013 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00018 0f 10 44 24 40 movups xmm0, XMMWORD PTR a$[rsp]
0001d f3 0f 10 c6 movss xmm0, xmm6
00021 0f 28 74 24 20 movaps xmm6, XMMWORD PTR [rsp+32]
00026 f3 0f 51 c0 sqrtss xmm0, xmm0
; 170 : __m128 ret = _mm_sqrt_ss(*(__m128*) & a);
; 171 :
; 172 : return ret.m128_f32[0];
; 173 : }
0002a 48 83 c4 38 add rsp, 56 ; 00000038H
0002e c3 ret 0
sqrtss_const ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\linear.c
; COMDAT divps
_TEXT SEGMENT
ptr1$ = 48
ptr2$ = 56
divps PROC ; COMDAT
; 154 : {
$LN7:
00000 48 89 5c 24 08 mov QWORD PTR [rsp+8], rbx
00005 57 push rdi
00006 48 83 ec 20 sub rsp, 32 ; 00000020H
0000a 48 8b f9 mov rdi, rcx
0000d 48 8b da mov rbx, rdx
00010 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__B5461FF6_linear@c
00017 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
0001c ba 10 00 00 00 mov edx, 16
00021 8b ca mov ecx, edx
00023 ff 15 00 00 00
00 call QWORD PTR __imp__aligned_malloc
00029 48 85 c0 test rax, rax
0002c 74 14 je SHORT $LN2@divps
; 155 : __m128* ret = _aligned_malloc(sizeof(__m128), 16);
; 156 :
; 157 : if (NULL != ret)
; 158 : {
; 159 : *ret = _mm_div_ps(*ptr1, *ptr2);
0002e 0f 10 07 movups xmm0, XMMWORD PTR [rdi]
00031 0f 5e 03 divps xmm0, XMMWORD PTR [rbx]
00034 0f 11 00 movups XMMWORD PTR [rax], xmm0
; 160 : return ret;
; 161 : }
; 162 : else
; 163 : {
; 164 : return -1;
; 165 : }
; 166 : }
00037 48 8b 5c 24 30 mov rbx, QWORD PTR [rsp+48]
0003c 48 83 c4 20 add rsp, 32 ; 00000020H
00040 5f pop rdi
00041 c3 ret 0
$LN2@divps:
00042 48 8b 5c 24 30 mov rbx, QWORD PTR [rsp+48]
00047 48 c7 c0 ff ff
ff ff mov rax, -1
0004e 48 83 c4 20 add rsp, 32 ; 00000020H
00052 5f pop rdi
00053 c3 ret 0
divps ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\linear.c
; COMDAT divps_const
_TEXT SEGMENT
c$ = 32
ptr$ = 80
value$ = 88
divps_const PROC ; COMDAT
; 135 : {
$LN7:
00000 40 53 push rbx
00002 48 83 ec 40 sub rsp, 64 ; 00000040H
00006 0f 29 74 24 30 movaps XMMWORD PTR [rsp+48], xmm6
0000b 48 8b d9 mov rbx, rcx
0000e 0f 28 f1 movaps xmm6, xmm1
00011 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__B5461FF6_linear@c
00018 0f c6 f6 00 shufps xmm6, xmm6, 0
0001c e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00021 ba 10 00 00 00 mov edx, 16
00026 8b ca mov ecx, edx
00028 0f 11 74 24 20 movups XMMWORD PTR c$[rsp], xmm6
0002d ff 15 00 00 00
00 call QWORD PTR __imp__aligned_malloc
00033 48 85 c0 test rax, rax
00036 74 17 je SHORT $LN2@divps_cons
; 136 :
; 137 : float c[4] = { value, value, value, value };
; 138 : __m128* ret = _aligned_malloc(sizeof(__m128), 16);
; 139 :
; 140 : __m128 valueVec = _mm_loadu_ps(&c);
; 141 :
; 142 : if (NULL != ret)
; 143 : {
; 144 : *ret = _mm_div_ps(*ptr, valueVec);
00038 0f 10 0b movups xmm1, XMMWORD PTR [rbx]
0003b 0f 10 c6 movups xmm0, xmm6
0003e 0f 5e ce divps xmm1, xmm6
00041 0f 11 08 movups XMMWORD PTR [rax], xmm1
; 145 : return ret;
; 146 : }
; 147 : else
; 148 : {
; 149 : return -1;
; 150 : }
; 151 : }
00044 0f 28 74 24 30 movaps xmm6, XMMWORD PTR [rsp+48]
00049 48 83 c4 40 add rsp, 64 ; 00000040H
0004d 5b pop rbx
0004e c3 ret 0
$LN2@divps_cons:
0004f 0f 28 74 24 30 movaps xmm6, XMMWORD PTR [rsp+48]
00054 48 c7 c0 ff ff
ff ff mov rax, -1
0005b 48 83 c4 40 add rsp, 64 ; 00000040H
0005f 5b pop rbx
00060 c3 ret 0
divps_const ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\linear.c
; COMDAT mulps_sum
_TEXT SEGMENT
ptr1$ = 48
ptr2$ = 56
mulps_sum PROC ; COMDAT
; 114 : {
$LN4:
00000 48 89 5c 24 08 mov QWORD PTR [rsp+8], rbx
00005 57 push rdi
00006 48 83 ec 20 sub rsp, 32 ; 00000020H
0000a 48 8b d9 mov rbx, rcx
0000d 48 8b fa mov rdi, rdx
00010 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__B5461FF6_linear@c
00017 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
0001c 0f 10 03 movups xmm0, XMMWORD PTR [rbx]
0001f 0f 59 07 mulps xmm0, XMMWORD PTR [rdi]
00022 48 8b 5c 24 30 mov rbx, QWORD PTR [rsp+48]
00027 f2 0f 7c c0 haddps xmm0, xmm0
0002b f2 0f 7c c0 haddps xmm0, xmm0
; 115 : __m128 ret = _mm_mul_ps(*ptr1,*ptr2);
; 116 : ret = _mm_hadd_ps(ret,ret);
; 117 : ret = _mm_hadd_ps(ret,ret);
; 118 : return *(float*)&ret;
; 119 : }
0002f 48 83 c4 20 add rsp, 32 ; 00000020H
00033 5f pop rdi
00034 c3 ret 0
mulps_sum ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\linear.c
; COMDAT mulps
_TEXT SEGMENT
ptr1$ = 48
ptr2$ = 56
mulps PROC ; COMDAT
; 99 : {
$LN7:
00000 48 89 5c 24 08 mov QWORD PTR [rsp+8], rbx
00005 57 push rdi
00006 48 83 ec 20 sub rsp, 32 ; 00000020H
0000a 48 8b f9 mov rdi, rcx
0000d 48 8b da mov rbx, rdx
00010 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__B5461FF6_linear@c
00017 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
0001c ba 10 00 00 00 mov edx, 16
00021 8b ca mov ecx, edx
00023 ff 15 00 00 00
00 call QWORD PTR __imp__aligned_malloc
00029 48 85 c0 test rax, rax
0002c 74 14 je SHORT $LN2@mulps
; 100 : __m128* ret = _aligned_malloc(sizeof(__m128), 16);
; 101 :
; 102 : if (NULL != ret)
; 103 : {
; 104 : *ret = _mm_mul_ps(*ptr1, *ptr2);
0002e 0f 10 07 movups xmm0, XMMWORD PTR [rdi]
00031 0f 59 03 mulps xmm0, XMMWORD PTR [rbx]
00034 0f 11 00 movups XMMWORD PTR [rax], xmm0
; 105 : return ret;
; 106 : }
; 107 : else
; 108 : {
; 109 : return -1;
; 110 : }
; 111 : }
00037 48 8b 5c 24 30 mov rbx, QWORD PTR [rsp+48]
0003c 48 83 c4 20 add rsp, 32 ; 00000020H
00040 5f pop rdi
00041 c3 ret 0
$LN2@mulps:
00042 48 8b 5c 24 30 mov rbx, QWORD PTR [rsp+48]
00047 48 c7 c0 ff ff
ff ff mov rax, -1
0004e 48 83 c4 20 add rsp, 32 ; 00000020H
00052 5f pop rdi
00053 c3 ret 0
mulps ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\linear.c
; COMDAT mulps_const
_TEXT SEGMENT
c$ = 32
ptr$ = 80
value$ = 88
mulps_const PROC ; COMDAT
; 81 : {
$LN7:
00000 40 53 push rbx
00002 48 83 ec 40 sub rsp, 64 ; 00000040H
00006 0f 29 74 24 30 movaps XMMWORD PTR [rsp+48], xmm6
0000b 48 8b d9 mov rbx, rcx
0000e 0f 28 f1 movaps xmm6, xmm1
00011 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__B5461FF6_linear@c
00018 0f c6 f6 00 shufps xmm6, xmm6, 0
0001c e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00021 ba 10 00 00 00 mov edx, 16
00026 8b ca mov ecx, edx
00028 0f 11 74 24 20 movups XMMWORD PTR c$[rsp], xmm6
0002d ff 15 00 00 00
00 call QWORD PTR __imp__aligned_malloc
00033 48 85 c0 test rax, rax
00036 74 14 je SHORT $LN2@mulps_cons
; 82 : float c[4] = { value, value, value, value };
; 83 : __m128* ret = _aligned_malloc(sizeof(__m128),16);
; 84 :
; 85 : __m128 valueVec = _mm_loadu_ps(&c);
; 86 :
; 87 : if (NULL != ret)
; 88 : {
; 89 : *ret = _mm_mul_ps(*ptr,valueVec);
00038 0f 10 c6 movups xmm0, xmm6
0003b 0f 59 03 mulps xmm0, XMMWORD PTR [rbx]
0003e 0f 11 00 movups XMMWORD PTR [rax], xmm0
; 90 : return ret;
; 91 : }
; 92 : else
; 93 : {
; 94 : return -1;
; 95 : }
; 96 : }
00041 0f 28 74 24 30 movaps xmm6, XMMWORD PTR [rsp+48]
00046 48 83 c4 40 add rsp, 64 ; 00000040H
0004a 5b pop rbx
0004b c3 ret 0
$LN2@mulps_cons:
0004c 0f 28 74 24 30 movaps xmm6, XMMWORD PTR [rsp+48]
00051 48 c7 c0 ff ff
ff ff mov rax, -1
00058 48 83 c4 40 add rsp, 64 ; 00000040H
0005c 5b pop rbx
0005d c3 ret 0
mulps_const ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\linear.c
; COMDAT subps
_TEXT SEGMENT
ptr1$ = 48
ptr2$ = 56
subps PROC ; COMDAT
; 66 : {
$LN7:
00000 48 89 5c 24 08 mov QWORD PTR [rsp+8], rbx
00005 57 push rdi
00006 48 83 ec 20 sub rsp, 32 ; 00000020H
0000a 48 8b f9 mov rdi, rcx
0000d 48 8b da mov rbx, rdx
00010 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__B5461FF6_linear@c
00017 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
0001c ba 10 00 00 00 mov edx, 16
00021 8d 4a f8 lea ecx, QWORD PTR [rdx-8]
00024 ff 15 00 00 00
00 call QWORD PTR __imp__aligned_malloc
0002a 48 85 c0 test rax, rax
0002d 74 14 je SHORT $LN2@subps
; 67 : __m128* ret = _aligned_malloc(sizeof(__m128*), 16);
; 68 :
; 69 : if (NULL != ret)
; 70 : {
; 71 : *ret = _mm_sub_ps(*ptr1, *ptr2);
0002f 0f 10 07 movups xmm0, XMMWORD PTR [rdi]
00032 0f 5c 03 subps xmm0, XMMWORD PTR [rbx]
00035 0f 11 00 movups XMMWORD PTR [rax], xmm0
; 72 : return ret;
; 73 : }
; 74 : else
; 75 : {
; 76 : return -1;
; 77 : }
; 78 : }
00038 48 8b 5c 24 30 mov rbx, QWORD PTR [rsp+48]
0003d 48 83 c4 20 add rsp, 32 ; 00000020H
00041 5f pop rdi
00042 c3 ret 0
$LN2@subps:
00043 48 8b 5c 24 30 mov rbx, QWORD PTR [rsp+48]
00048 48 c7 c0 ff ff
ff ff mov rax, -1
0004f 48 83 c4 20 add rsp, 32 ; 00000020H
00053 5f pop rdi
00054 c3 ret 0
subps ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\linear.c
; COMDAT addps
_TEXT SEGMENT
ptr1$ = 48
ptr2$ = 56
addps PROC ; COMDAT
; 49 : {
$LN7:
00000 48 89 5c 24 08 mov QWORD PTR [rsp+8], rbx
00005 57 push rdi
00006 48 83 ec 20 sub rsp, 32 ; 00000020H
0000a 48 8b f9 mov rdi, rcx
0000d 48 8b da mov rbx, rdx
00010 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__B5461FF6_linear@c
00017 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
0001c ba 10 00 00 00 mov edx, 16
00021 8d 4a f8 lea ecx, QWORD PTR [rdx-8]
00024 ff 15 00 00 00
00 call QWORD PTR __imp__aligned_malloc
0002a 48 85 c0 test rax, rax
0002d 74 14 je SHORT $LN2@addps
; 50 :
; 51 : __m128* ret = _aligned_malloc(sizeof(__m128*),16);
; 52 :
; 53 : if (NULL != ret)
; 54 : {
; 55 : *ret = _mm_add_ps(*ptr1, *ptr2);
0002f 0f 10 07 movups xmm0, XMMWORD PTR [rdi]
00032 0f 58 03 addps xmm0, XMMWORD PTR [rbx]
00035 0f 11 00 movups XMMWORD PTR [rax], xmm0
; 56 : return ret;
; 57 : }
; 58 : else
; 59 : {
; 60 : return (__m128*) - 1;
; 61 : }
; 62 :
; 63 : }
00038 48 8b 5c 24 30 mov rbx, QWORD PTR [rsp+48]
0003d 48 83 c4 20 add rsp, 32 ; 00000020H
00041 5f pop rdi
00042 c3 ret 0
$LN2@addps:
00043 48 8b 5c 24 30 mov rbx, QWORD PTR [rsp+48]
00048 48 c7 c0 ff ff
ff ff mov rax, -1
0004f 48 83 c4 20 add rsp, 32 ; 00000020H
00053 5f pop rdi
00054 c3 ret 0
addps ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\linear.c
; COMDAT load_cpy
_TEXT SEGMENT
ptr$ = 48
load_cpy PROC ; COMDAT
; 37 : {
$LN7:
00000 40 53 push rbx
00002 48 83 ec 20 sub rsp, 32 ; 00000020H
00006 48 8b d9 mov rbx, rcx
00009 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__B5461FF6_linear@c
00010 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00015 ba 10 00 00 00 mov edx, 16
0001a 8d 4a f8 lea ecx, QWORD PTR [rdx-8]
0001d ff 15 00 00 00
00 call QWORD PTR __imp__aligned_malloc
00023 48 85 c0 test rax, rax
00026 74 06 je SHORT $LN4@load_cpy
; 38 : __m128* ret = _aligned_malloc(sizeof(__m128*),16);
; 39 :
; 40 : if (NULL != ret)
; 41 : {
; 42 : *ret = *ptr;
00028 0f 10 03 movups xmm0, XMMWORD PTR [rbx]
0002b 0f 11 00 movups XMMWORD PTR [rax], xmm0
$LN4@load_cpy:
; 43 : }
; 44 :
; 45 : return ret;
; 46 : }
0002e 48 83 c4 20 add rsp, 32 ; 00000020H
00032 5b pop rbx
00033 c3 ret 0
load_cpy ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\linear.c
; COMDAT load
_TEXT SEGMENT
array$ = 32
x$ = 128
y$ = 136
z$ = 144
w$ = 152
load PROC ; COMDAT
; 21 : {
$LN7:
00000 48 83 ec 78 sub rsp, 120 ; 00000078H
00004 0f 29 74 24 60 movaps XMMWORD PTR [rsp+96], xmm6
00009 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__B5461FF6_linear@c
00010 0f 29 7c 24 50 movaps XMMWORD PTR [rsp+80], xmm7
00015 0f 28 f0 movaps xmm6, xmm0
00018 44 0f 29 44 24
40 movaps XMMWORD PTR [rsp+64], xmm8
0001e 0f 28 f9 movaps xmm7, xmm1
00021 44 0f 29 4c 24
30 movaps XMMWORD PTR [rsp+48], xmm9
00027 44 0f 28 c2 movaps xmm8, xmm2
0002b 44 0f 28 cb movaps xmm9, xmm3
0002f e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00034 ba 10 00 00 00 mov edx, 16
00039 f3 0f 11 74 24
20 movss DWORD PTR array$[rsp], xmm6
0003f 8b ca mov ecx, edx
00041 f3 0f 11 7c 24
24 movss DWORD PTR array$[rsp+4], xmm7
00047 f3 44 0f 11 44
24 28 movss DWORD PTR array$[rsp+8], xmm8
0004e f3 44 0f 11 4c
24 2c movss DWORD PTR array$[rsp+12], xmm9
00055 ff 15 00 00 00
00 call QWORD PTR __imp__aligned_malloc
0005b 48 85 c0 test rax, rax
0005e 74 0a je SHORT $LN2@load
; 22 : float array[4] = {x,y,z,w};
; 23 : __m128* ptr = _aligned_malloc(sizeof(__m128),16);
; 24 :
; 25 : if (NULL != ptr)
; 26 : {
; 27 : *ptr = _mm_loadu_ps(&array);
00060 0f 10 44 24 20 movups xmm0, XMMWORD PTR array$[rsp]
00065 0f 11 00 movups XMMWORD PTR [rax], xmm0
; 28 : return ptr;
00068 eb 07 jmp SHORT $LN3@load
$LN2@load:
; 29 : }
; 30 : else
; 31 : {
; 32 : return -1;
0006a 48 c7 c0 ff ff
ff ff mov rax, -1
$LN3@load:
; 33 : }
; 34 : }
00071 0f 28 74 24 60 movaps xmm6, XMMWORD PTR [rsp+96]
00076 0f 28 7c 24 50 movaps xmm7, XMMWORD PTR [rsp+80]
0007b 44 0f 28 44 24
40 movaps xmm8, XMMWORD PTR [rsp+64]
00081 44 0f 28 4c 24
30 movaps xmm9, XMMWORD PTR [rsp+48]
00087 48 83 c4 78 add rsp, 120 ; 00000078H
0008b c3 ret 0
load ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\linear.c
; COMDAT mulps_total_internal
_TEXT SEGMENT
vec$ = 8
mulps_total_internal PROC ; COMDAT
00000 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__B5461FF6_linear@c
00007 e9 00 00 00 00 jmp __CheckForDebuggerJustMyCode
mulps_total_internal ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgShqrpGraphic\linear.c
; COMDAT mulps_sum_internal
_TEXT SEGMENT
left$ = 48
right$ = 56
mulps_sum_internal PROC ; COMDAT
; 122 : {
$LN4:
00000 48 89 5c 24 08 mov QWORD PTR [rsp+8], rbx
00005 57 push rdi
00006 48 83 ec 20 sub rsp, 32 ; 00000020H
0000a 48 8b d9 mov rbx, rcx
0000d 48 8b fa mov rdi, rdx
00010 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__B5461FF6_linear@c
00017 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
0001c 0f 10 03 movups xmm0, XMMWORD PTR [rbx]
0001f 0f 59 07 mulps xmm0, XMMWORD PTR [rdi]
00022 48 8b 5c 24 30 mov rbx, QWORD PTR [rsp+48]
00027 f2 0f 7c c0 haddps xmm0, xmm0
0002b f2 0f 7c c0 haddps xmm0, xmm0
; 123 : __m128 ret = _mm_mul_ps(left, right);
; 124 : ret = _mm_hadd_ps(ret, ret);
; 125 : ret = _mm_hadd_ps(ret, ret);
; 126 : return *(float*)&ret;
; 127 : }
0002f 48 83 c4 20 add rsp, 32 ; 00000020H
00033 5f pop rdi
00034 c3 ret 0
mulps_sum_internal ENDP
_TEXT ENDS
END
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More