RuntimeStateBroadcastRequested
All checks were successful
CI / React UI Build (push) Successful in 10s
CI / Native Windows Build And Tests (push) Successful in 2m21s
CI / Windows Release Package (push) Successful in 2m23s

This commit is contained in:
Aiden
2026-05-11 15:19:43 +10:00
parent b3705d96cc
commit ccfc0237fd
2 changed files with 23 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
#include "RuntimeUpdateController.h"
#include "RenderEngine.h"
#include "RuntimeEventDispatcher.h"
#include "RuntimeServices.h"
#include "RuntimeStore.h"
#include "ShaderBuildQueue.h"
@@ -24,6 +25,9 @@ RuntimeUpdateController::RuntimeUpdateController(
mShaderBuildQueue(shaderBuildQueue),
mVideoBackend(videoBackend)
{
mRuntimeEventDispatcher.Subscribe(
RuntimeEventType::RuntimeStateBroadcastRequested,
[this](const RuntimeEvent& event) { HandleRuntimeStateBroadcastRequested(event); });
}
bool RuntimeUpdateController::ApplyRuntimeCoordinatorResult(const RuntimeCoordinatorResult& result, std::string* error)
@@ -62,6 +66,8 @@ bool RuntimeUpdateController::ApplyRuntimeCoordinatorResult(const RuntimeCoordin
bool RuntimeUpdateController::ProcessRuntimeWork()
{
mRuntimeEventDispatcher.DispatchPending();
bool shaderBuildRequested = false;
std::vector<RuntimeCoordinatorServiceResult> serviceResults;
mRuntimeServices.ConsumeRuntimeCoordinatorResults(serviceResults);
@@ -101,5 +107,19 @@ void RuntimeUpdateController::RequestShaderBuild()
void RuntimeUpdateController::BroadcastRuntimeState()
{
RuntimeStateBroadcastRequestedEvent event;
event.reason = "runtime-state-changed";
if (!mRuntimeEventDispatcher.PublishPayload(event, "RuntimeUpdateController"))
{
mRuntimeServices.BroadcastState();
return;
}
mRuntimeEventDispatcher.DispatchPending();
}
void RuntimeUpdateController::HandleRuntimeStateBroadcastRequested(const RuntimeEvent& event)
{
(void)event;
mRuntimeServices.BroadcastState();
}