New rules based order
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "AppConfig.h"
|
||||
#include "../runtime/RuntimeSlangShaderCompiler.h"
|
||||
#include "../runtime/RuntimeShaderBridge.h"
|
||||
#include "../telemetry/TelemetryPrinter.h"
|
||||
#include "../video/DeckLinkOutput.h"
|
||||
#include "../video/DeckLinkOutputThread.h"
|
||||
@@ -143,34 +143,19 @@ private:
|
||||
|
||||
void StartRuntimeShaderBuild()
|
||||
{
|
||||
mShaderCompiler.StartHappyAccidentBuild();
|
||||
mShaderBridgeStopping = false;
|
||||
mShaderBridgeThread = std::thread([this]() { ShaderBridgeMain(); });
|
||||
mShaderBridge.Start(
|
||||
mConfig.runtimeShaderId,
|
||||
[this](const RuntimeShaderArtifact& artifact) {
|
||||
mRenderThread.SubmitRuntimeShaderArtifact(artifact);
|
||||
},
|
||||
[](const std::string& message) {
|
||||
std::cout << "Runtime Slang build failed: " << message << "\n";
|
||||
});
|
||||
}
|
||||
|
||||
void StopRuntimeShaderBuild()
|
||||
{
|
||||
mShaderBridgeStopping = true;
|
||||
if (mShaderBridgeThread.joinable())
|
||||
mShaderBridgeThread.join();
|
||||
mShaderCompiler.Stop();
|
||||
}
|
||||
|
||||
void ShaderBridgeMain()
|
||||
{
|
||||
while (!mShaderBridgeStopping)
|
||||
{
|
||||
RuntimeSlangShaderBuild build;
|
||||
if (mShaderCompiler.TryConsume(build))
|
||||
{
|
||||
if (build.succeeded)
|
||||
mRenderThread.SubmitRuntimeShaderArtifact(build.artifact);
|
||||
else
|
||||
std::cout << "Runtime Slang build failed: " << build.message << "\n";
|
||||
return;
|
||||
}
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(5));
|
||||
}
|
||||
mShaderBridge.Stop();
|
||||
}
|
||||
|
||||
RenderThread& mRenderThread;
|
||||
@@ -179,9 +164,7 @@ private:
|
||||
DeckLinkOutput mOutput;
|
||||
DeckLinkOutputThread<SystemFrameExchange> mOutputThread;
|
||||
TelemetryPrinter mTelemetry;
|
||||
RuntimeSlangShaderCompiler mShaderCompiler;
|
||||
std::thread mShaderBridgeThread;
|
||||
std::atomic<bool> mShaderBridgeStopping{ false };
|
||||
RuntimeShaderBridge mShaderBridge;
|
||||
bool mStarted = false;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user