Add support for AVX2 and runtime feature detection (#174)

- [x] run unit tests
- [x] run all samples
This commit is contained in:
Ethan Rutherford 2026-10-04 00:14:34 +02:00 • committed by GitHub
commit e77352cd60
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
53 changed files with 4681 additions and 3376 deletions

View file

@ -245,6 +245,8 @@ b3WorldId b3CreateWorld( const b3WorldDef* def )
memset( world, 0, sizeof( b3World ) );
world->simdWidth = b3GetSIMDWidth();
world->worldId = (uint16_t)worldId;
world->generation = revision;
world->inUse = true;
@ -2029,6 +2031,17 @@ bool b3World_IsWarmStartingEnabled( b3WorldId worldId )
return world->enableWarmStarting;
}
void b3World_EnableSSE2Fallback( b3WorldId worldId, bool flag )
{
b3World* world = b3GetUnlockedWorldFromId( worldId );
if ( world == NULL )
{
return;
}
world->simdWidth = flag ? 4 : b3GetSIMDWidth();
}
int b3World_GetAwakeBodyCount( b3WorldId worldId )
{
b3World* world = b3GetUnlockedWorldFromId( worldId );