Phase 3 refactor in progress
Some checks failed
CI / React UI Build (push) Successful in 10s
CI / Native Windows Build And Tests (push) Successful in 2m33s
CI / Windows Release Package (push) Has been cancelled

This commit is contained in:
Aiden
2026-05-11 16:48:52 +10:00
parent 0808171677
commit 06f3dd4942
12 changed files with 655 additions and 87 deletions

View File

@@ -7,6 +7,7 @@
#include "RuntimeCoordinator.h"
#include "RuntimeEventDispatcher.h"
#include "RuntimeParameterUtils.h"
#include "RuntimeServiceLiveBridge.h"
#include "RuntimeServices.h"
#include "RuntimeSnapshotProvider.h"
#include "RuntimeStore.h"
@@ -302,61 +303,30 @@ void OpenGLComposite::renderEffect()
{
if (mRuntimeUpdateController)
mRuntimeUpdateController->ProcessRuntimeWork();
std::vector<RuntimeServices::AppliedOscUpdate> appliedOscUpdates;
std::vector<RuntimeServices::CompletedOscCommit> completedOscCommits;
if (mRuntimeServices)
{
std::string oscError;
if (!mRuntimeServices->ApplyPendingOscUpdates(appliedOscUpdates, oscError) && !oscError.empty())
OutputDebugStringA(("OSC apply failed: " + oscError + "\n").c_str());
mRuntimeServices->ConsumeCompletedOscCommits(completedOscCommits);
}
std::vector<RenderEngine::OscOverlayUpdate> overlayUpdates;
overlayUpdates.reserve(appliedOscUpdates.size());
for (const RuntimeServices::AppliedOscUpdate& update : appliedOscUpdates)
{
overlayUpdates.push_back({ update.routeKey, update.layerKey, update.parameterKey, update.targetValue });
}
std::vector<RenderEngine::OscOverlayCommitCompletion> overlayCommitCompletions;
overlayCommitCompletions.reserve(completedOscCommits.size());
for (const RuntimeServices::CompletedOscCommit& completedCommit : completedOscCommits)
{
overlayCommitCompletions.push_back({ completedCommit.routeKey, completedCommit.generation });
}
if (mRenderEngine)
mRenderEngine->UpdateOscOverlayState(overlayUpdates, overlayCommitCompletions);
const bool hasInputSource = mVideoBackend->HasInputSource();
std::vector<RuntimeRenderState> layerStates;
std::vector<RenderEngine::OscOverlayCommitRequest> overlayCommitRequests;
const double smoothing = mRuntimeStore ? mRuntimeStore->GetConfiguredOscSmoothing() : 0.0;
mRenderEngine->ResolveRenderLayerStates(
mRuntimeCoordinator && mRuntimeCoordinator->UseCommittedLayerStates(),
mVideoBackend->InputFrameWidth(),
mVideoBackend->InputFrameHeight(),
smoothing,
&overlayCommitRequests,
layerStates);
if (mRuntimeServices)
{
for (const RenderEngine::OscOverlayCommitRequest& commitRequest : overlayCommitRequests)
{
std::string commitError;
if (!mRuntimeServices->QueueOscCommit(
commitRequest.routeKey,
commitRequest.layerKey,
commitRequest.parameterKey,
commitRequest.value,
commitRequest.generation,
commitError) &&
!commitError.empty())
{
OutputDebugStringA(("OSC commit queue failed: " + commitError + "\n").c_str());
}
}
RuntimeServiceLiveBridge::PrepareLiveRenderLayerStates(
*mRuntimeServices,
*mRenderEngine,
mRuntimeCoordinator && mRuntimeCoordinator->UseCommittedLayerStates(),
mVideoBackend->InputFrameWidth(),
mVideoBackend->InputFrameHeight(),
smoothing,
layerStates);
}
else
{
mRenderEngine->ResolveRenderLayerStates(
mRuntimeCoordinator && mRuntimeCoordinator->UseCommittedLayerStates(),
mVideoBackend->InputFrameWidth(),
mVideoBackend->InputFrameHeight(),
smoothing,
nullptr,
layerStates);
}
const unsigned historyCap = mRuntimeStore ? mRuntimeStore->GetConfiguredMaxTemporalHistoryFrames() : 0;
mRenderEngine->RenderLayerStack(