further sse simd additions

avx2 float3 added
added normalize_magnitude
added divide fast to float3 may copy to float4

move static spheremesh to drawSphere (initialize on first use) so platform has a chance to load the math backend
This commit is contained in:
marauder2k7 2026-02-26 21:11:31 +00:00
parent 2559145c06
commit 18d0aa0418
16 changed files with 337 additions and 77 deletions

View file

@ -853,7 +853,11 @@ void GFXDrawUtil::drawThickLine(F32 x1, F32 y1, F32 z1, F32 x2, F32 y2, F32 z2,
// 3D World Draw Misc
//-----------------------------------------------------------------------------
static SphereMesh gSphere;
SphereMesh& getSphere()
{
static SphereMesh instance;
return instance;
}
void GFXDrawUtil::drawSphere( const GFXStateBlockDesc &desc, F32 radius, const Point3F &pos, const ColorI &color, bool drawTop, bool drawBottom, const MatrixF *xfm )
{
@ -868,7 +872,7 @@ void GFXDrawUtil::drawSphere( const GFXStateBlockDesc &desc, F32 radius, const P
GFX->pushWorldMatrix();
GFX->multWorld(mat);
const SphereMesh::TriangleMesh * sphereMesh = gSphere.getMesh(2);
const SphereMesh::TriangleMesh * sphereMesh = getSphere().getMesh(2);
S32 numPoly = sphereMesh->numPoly;
S32 totalPoly = 0;
GFXVertexBufferHandle<GFXVertexPCT> verts(mDevice, numPoly*3, GFXBufferTypeVolatile);