ISA backends float3 and float4 - cleanup history squash

working for both neon32 and neon64

Update math_backend.cpp

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

all float3 and float4 functions and isas

completed all options of float3 and float4 functions in isas and math_c
neon still to be done but that will be on mac.

Update math_backend.cpp

mac isa neon update

added float3
restructured the classes to look more like the final version of the x86 classes

linux required changes

Update build-macos-clang.yml

Update build-macos-clang.yml

Revert "Update build-macos-clang.yml"

This reverts commit 29dfc567f4.

Revert "Update build-macos-clang.yml"

This reverts commit 2abad2b4ca.

Update CMakeLists.txt

fix macs stupid build

remove god awful rolling average from frame time tracker....

use intrinsic headers instead

each isa implementation now uses a header for that isa's intrinsic functions these are then used in the impl files. This will make it easier for matrix functions when those are implemented.

fixed comment saying 256 when it should be 512 for avx512

consolidated initializers for function tables

Update neon_intrinsics.h

fixes for some neon intrinsics no idea if this is the best way to do these but they work at least

v_cross is especially messy at the moment we basically just do it as a c math function need to look into getting this done correctly
This commit is contained in:
marauder2k7 2026-02-26 16:45:13 +00:00
parent 73ed502ac9
commit 67f12311d4
36 changed files with 1481 additions and 419 deletions

View file

@ -36,6 +36,8 @@ void FPSTracker::reset()
{
fpsNext = (F32)Platform::getRealMilliseconds()/1000.0f + mUpdateInterval;
fpsAccumTime = 0.0f;
fpsAccumVirtualTime = 0.0f;
fpsRealLast = 0.0f;
fpsReal = 0.0f;
fpsRealMin = 0.000001f; // Avoid division by zero.
@ -51,42 +53,60 @@ void FPSTracker::update()
F32 realSeconds = (F32)Platform::getRealMilliseconds()/1000.0f;
F32 virtualSeconds = (F32)Platform::getVirtualMilliseconds()/1000.0f;
fpsFrames++;
if (fpsFrames > 1)
if (fpsRealLast == 0.0f)
{
fpsReal = fpsReal*(1.0-alpha) + (realSeconds-fpsRealLast)*alpha;
fpsVirtual = fpsVirtual*(1.0-alpha) + (virtualSeconds-fpsVirtualLast)*alpha;
if( fpsFrames > 10 ) // Wait a few frames before updating these.
{
// Update min/max. This is a bit counter-intuitive, as the comparisons are
// inversed because these are all one-over-x values.
if( fpsReal > fpsRealMin )
fpsRealMin = fpsReal;
if( fpsReal < fpsRealMax )
fpsRealMax = fpsReal;
}
fpsRealLast = realSeconds;
fpsVirtualLast = virtualSeconds;
return;
}
fpsRealLast = realSeconds;
F32 frameTimeReal = realSeconds - fpsRealLast;
F32 frameTimeVirtual = virtualSeconds - fpsVirtualLast;
fpsRealLast = realSeconds;
fpsVirtualLast = virtualSeconds;
// update variables every few frames
F32 update = fpsRealLast - fpsNext;
if (update > 0.5f)
{
F32 delta = realSeconds - fpsNext;
Con::setVariable( "fps::frameDelta",avar("%g", delta));
Con::setVariable( "fps::real", avar( "%4.1f", 1.0f / fpsReal ) );
Con::setVariable( "fps::realMin", avar( "%4.1f", 1.0f / fpsRealMin ) );
Con::setVariable( "fps::realMax", avar( "%4.1f", 1.0f / fpsRealMax ) );
Con::setVariable( "fps::virtual", avar( "%4.1f", 1.0f / fpsVirtual ) );
// Accumulate for windowed FPS calculation
fpsFrames++;
fpsAccumTime += frameTimeReal;
fpsAccumVirtualTime += frameTimeVirtual;
if (update > mUpdateInterval)
fpsNext = fpsRealLast + mUpdateInterval;
else
fpsNext += mUpdateInterval;
// Only update console values at interval
if (realSeconds >= fpsNext)
{
fpsReal = 0.0f;
fpsVirtual = 0.0f;
if (fpsAccumTime > 0.0f)
fpsReal = fpsFrames / fpsAccumTime;
if (fpsAccumVirtualTime > 0.0f)
fpsVirtual = fpsFrames / fpsAccumVirtualTime;
// Update min/max correctly (these are FPS now)
if (fpsReal > 0.0f)
{
if (fpsReal < fpsRealMin)
fpsRealMin = fpsReal;
if (fpsReal > fpsRealMax)
fpsRealMax = fpsReal;
}
// frameDelta = actual accumulated real time over window
Con::setVariable("fps::frameTimeMs", avar("%4.3f", (fpsAccumTime / fpsFrames) * 1000.0f));
Con::setVariable("fps::frameDelta", avar("%g", fpsAccumTime));
Con::setVariable("fps::real", avar("%4.1f", fpsReal));
Con::setVariable("fps::realMin", avar("%4.1f", fpsRealMin));
Con::setVariable("fps::realMax", avar("%4.1f", fpsRealMax));
Con::setVariable("fps::virtual", avar("%4.1f", fpsVirtual));
// Reset window
fpsFrames = 0;
fpsAccumTime = 0.0f;
fpsAccumVirtualTime = 0.0f;
fpsNext = realSeconds + mUpdateInterval;
}
}

View file

@ -27,6 +27,8 @@
struct FPSTracker
{
F32 fpsAccumTime;
F32 fpsAccumVirtualTime;
F32 fpsRealLast;
F32 fpsReal;
F32 fpsRealMin;
@ -48,4 +50,4 @@ struct FPSTracker
extern FPSTracker gFPS;
#endif
#endif