pass 1
This commit is contained in:
@@ -31,20 +31,19 @@ OpenGLComposite::OpenGLComposite(HWND hWnd, HDC hDC, HGLRC hRC) :
|
||||
mScreenshotRequested(false)
|
||||
{
|
||||
InitializeCriticalSection(&pMutex);
|
||||
mRuntimeHost = std::make_unique<RuntimeHost>();
|
||||
mRuntimeStore = std::make_unique<RuntimeStore>(*mRuntimeHost);
|
||||
mRuntimeSnapshotProvider = std::make_unique<RuntimeSnapshotProvider>(*mRuntimeHost);
|
||||
mRuntimeStore = std::make_unique<RuntimeStore>();
|
||||
mRuntimeSnapshotProvider = std::make_unique<RuntimeSnapshotProvider>(*mRuntimeStore);
|
||||
mRuntimeCoordinator = std::make_unique<RuntimeCoordinator>(*mRuntimeStore);
|
||||
mRenderEngine = std::make_unique<RenderEngine>(
|
||||
*mRuntimeSnapshotProvider,
|
||||
mRuntimeHost->GetHealthTelemetry(),
|
||||
mRuntimeStore->GetHealthTelemetry(),
|
||||
pMutex,
|
||||
hGLDC,
|
||||
hGLRC,
|
||||
[this]() { renderEffect(); },
|
||||
[this]() { ProcessScreenshotRequest(); },
|
||||
[this]() { paintGL(false); });
|
||||
mVideoBackend = std::make_unique<VideoBackend>(*mRenderEngine, mRuntimeHost->GetHealthTelemetry());
|
||||
mVideoBackend = std::make_unique<VideoBackend>(*mRenderEngine, mRuntimeStore->GetHealthTelemetry());
|
||||
mShaderBuildQueue = std::make_unique<ShaderBuildQueue>(*mRuntimeSnapshotProvider);
|
||||
mRuntimeServices = std::make_unique<RuntimeServices>();
|
||||
}
|
||||
@@ -247,7 +246,7 @@ bool OpenGLComposite::InitOpenGLState()
|
||||
mRenderEngine->ResetShaderFeedbackState();
|
||||
|
||||
broadcastRuntimeState();
|
||||
mRuntimeServices->BeginPolling(*mRuntimeStore);
|
||||
mRuntimeServices->BeginPolling(*mRuntimeCoordinator);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -406,17 +405,18 @@ bool OpenGLComposite::ProcessRuntimePollResults()
|
||||
if (!mRuntimeServices)
|
||||
return true;
|
||||
|
||||
const RuntimePollEvents events = mRuntimeServices->ConsumePollEvents();
|
||||
if (events.failed)
|
||||
bool shaderBuildRequested = false;
|
||||
std::vector<RuntimeCoordinatorServiceResult> serviceResults;
|
||||
mRuntimeServices->ConsumeRuntimeCoordinatorResults(serviceResults);
|
||||
for (const RuntimeCoordinatorServiceResult& serviceResult : serviceResults)
|
||||
{
|
||||
ApplyRuntimeCoordinatorResult(mRuntimeCoordinator->HandleRuntimePollFailure(events.error));
|
||||
return false;
|
||||
shaderBuildRequested = shaderBuildRequested || serviceResult.result.shaderBuildRequested;
|
||||
ApplyRuntimeCoordinatorResult(serviceResult.result);
|
||||
if (serviceResult.failed)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (events.registryChanged)
|
||||
broadcastRuntimeState();
|
||||
|
||||
if (!events.reloadRequested)
|
||||
if (!shaderBuildRequested)
|
||||
{
|
||||
if (!mShaderBuildQueue || !mRenderEngine)
|
||||
return true;
|
||||
@@ -439,7 +439,6 @@ bool OpenGLComposite::ProcessRuntimePollResults()
|
||||
return true;
|
||||
}
|
||||
|
||||
ApplyRuntimeCoordinatorResult(mRuntimeCoordinator->HandleRuntimeReloadRequest());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
|
||||
#include "GLExtensions.h"
|
||||
#include "RuntimeCoordinator.h"
|
||||
#include "RuntimeHost.h"
|
||||
#include "RuntimeSnapshotProvider.h"
|
||||
#include "RuntimeStore.h"
|
||||
|
||||
@@ -73,7 +72,6 @@ private:
|
||||
HGLRC hGLRC;
|
||||
CRITICAL_SECTION pMutex;
|
||||
|
||||
std::unique_ptr<RuntimeHost> mRuntimeHost;
|
||||
std::unique_ptr<RuntimeStore> mRuntimeStore;
|
||||
std::unique_ptr<RuntimeCoordinator> mRuntimeCoordinator;
|
||||
std::unique_ptr<RuntimeSnapshotProvider> mRuntimeSnapshotProvider;
|
||||
|
||||
Reference in New Issue
Block a user