From 777d76250ae2608f15a348256679d932db177104 Mon Sep 17 00:00:00 2001 From: Austin Hudelson Date: Thu, 30 Oct 2025 23:46:12 -0400 Subject: [PATCH 1/2] Update --- src/PhoenixCore/Private/Parallel.cpp | 39 ++++++++++++++++++++++++++++ src/PhoenixSim/Private/Session.cpp | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/src/PhoenixCore/Private/Parallel.cpp b/src/PhoenixCore/Private/Parallel.cpp index 4f88da1..d731fcb 100644 --- a/src/PhoenixCore/Private/Parallel.cpp +++ b/src/PhoenixCore/Private/Parallel.cpp @@ -1,6 +1,41 @@ #include "Parallel.h" +#ifndef __EMSCRIPTEN__ +// Original implementation would go here for non-web builds +// For web builds, we'll provide simplified stubs + +namespace Phoenix +{ + namespace Threading + { + // Web-compatible implementation (simplified) + void SpinWait(uint32 cycles) + { + // Simple busy wait without intrinsics + for (uint32 i = 0; i < cycles; ++i) + { + // Empty loop for web compatibility + volatile uint32 dummy = i; + (void)dummy; + } + } + } +} + +#else +// Web build stubs +namespace Phoenix +{ + namespace Threading + { + void SpinWait(uint32 cycles) + { + // No-op for web builds + } + } +} + // xatomic.h is Windows-specific, using standard and from Parallel.h #include "PhoenixCore.h" @@ -137,3 +172,7 @@ void ThreadPool::Worker(size_t workerId) ActiveWorkerCount.fetch_sub(1, std::memory_order_acq_rel); } } + +#endif + + diff --git a/src/PhoenixSim/Private/Session.cpp b/src/PhoenixSim/Private/Session.cpp index 6e6f6b3..0426774 100644 --- a/src/PhoenixSim/Private/Session.cpp +++ b/src/PhoenixSim/Private/Session.cpp @@ -102,7 +102,7 @@ void Session::Tick(const SessionStepArgs& args) break; } - AccTickTime -= std::max(hz, stepElapsed); + AccTickTime -= std::max(static_cast(hz), stepElapsed); CurrTickTime = clock(); } From bda0019524febed908fa0563e2d016c876d92ae6 Mon Sep 17 00:00:00 2001 From: Austin Hudelson Date: Fri, 31 Oct 2025 00:06:15 -0400 Subject: [PATCH 2/2] fix it to be less broken --- src/PhoenixCore/Private/Parallel.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/PhoenixCore/Private/Parallel.cpp b/src/PhoenixCore/Private/Parallel.cpp index d731fcb..9411677 100644 --- a/src/PhoenixCore/Private/Parallel.cpp +++ b/src/PhoenixCore/Private/Parallel.cpp @@ -1,24 +1,18 @@ #include "Parallel.h" -#ifndef __EMSCRIPTEN__ +#ifdef __EMSCRIPTEN__ // Original implementation would go here for non-web builds // For web builds, we'll provide simplified stubs +// Web build stubs namespace Phoenix { - namespace Threading + namespace Threading { - // Web-compatible implementation (simplified) void SpinWait(uint32 cycles) { - // Simple busy wait without intrinsics - for (uint32 i = 0; i < cycles; ++i) - { - // Empty loop for web compatibility - volatile uint32 dummy = i; - (void)dummy; - } + // No-op for web builds } } }