Merge remote-tracking branch 'origin/master' into 1.11

# Conflicts:
#	Content/Editor/DebugMaterials/DDGIDebugProbes.flax
#	Source/Engine/Scripting/Scripting.cpp
This commit is contained in:
Wojtek Figat
2025-08-25 23:48:08 +02:00
121 changed files with 2016 additions and 1305 deletions

View File

@@ -108,6 +108,7 @@ namespace
MMethod* _method_LateFixedUpdate = nullptr;
MMethod* _method_Draw = nullptr;
MMethod* _method_Exit = nullptr;
Array<Function<void()>> UpdateActions;
Dictionary<StringAnsi, BinaryModule*, InlinedAllocation<64>> _nonNativeModules;
#if USE_EDITOR
bool LastBinariesLoadTriggeredCompilation = false;
@@ -245,6 +246,27 @@ void ScriptingService::Update()
PROFILE_CPU_NAMED("Scripting::Update");
INVOKE_EVENT(Update);
// Flush update actions
_objectsLocker.Lock();
int32 count = UpdateActions.Count();
for (int32 i = 0; i < count; i++)
{
UpdateActions[i]();
}
int32 newlyAdded = UpdateActions.Count() - count;
if (newlyAdded == 0)
UpdateActions.Clear();
else
{
// Someone added another action within current callback
Array<Function<void()>> tmp;
for (int32 i = newlyAdded; i < UpdateActions.Count(); i++)
tmp.Add(UpdateActions[i]);
UpdateActions.Clear();
UpdateActions.Add(tmp);
}
_objectsLocker.Unlock();
#if defined(USE_NETCORE) && !USE_EDITOR
// Force GC to run in background periodically to avoid large blocking collections causing hitches
if (Time::Update.TicksCount % 60 == 0)
@@ -311,6 +333,13 @@ void Scripting::ProcessBuildInfoPath(String& path, const String& projectFolderPa
path = projectFolderPath / path;
}
void Scripting::InvokeOnUpdate(const Function<void()>& action)
{
_objectsLocker.Lock();
UpdateActions.Add(action);
_objectsLocker.Unlock();
}
bool Scripting::LoadBinaryModules(const String& path, const String& projectFolderPath)
{
PROFILE_CPU_NAMED("LoadBinaryModules");