New rules based order
This commit is contained in:
33
apps/RenderCadenceCompositor/runtime/RuntimeShaderBridge.h
Normal file
33
apps/RenderCadenceCompositor/runtime/RuntimeShaderBridge.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#include "RuntimeShaderArtifact.h"
|
||||
#include "RuntimeSlangShaderCompiler.h"
|
||||
|
||||
#include <atomic>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
|
||||
class RuntimeShaderBridge
|
||||
{
|
||||
public:
|
||||
using ArtifactCallback = std::function<void(const RuntimeShaderArtifact&)>;
|
||||
using ErrorCallback = std::function<void(const std::string&)>;
|
||||
|
||||
RuntimeShaderBridge() = default;
|
||||
RuntimeShaderBridge(const RuntimeShaderBridge&) = delete;
|
||||
RuntimeShaderBridge& operator=(const RuntimeShaderBridge&) = delete;
|
||||
~RuntimeShaderBridge();
|
||||
|
||||
void Start(const std::string& shaderId, ArtifactCallback onArtifactReady, ErrorCallback onError);
|
||||
void Stop();
|
||||
|
||||
private:
|
||||
void ThreadMain();
|
||||
|
||||
RuntimeSlangShaderCompiler mCompiler;
|
||||
std::thread mThread;
|
||||
std::atomic<bool> mStopping{ false };
|
||||
ArtifactCallback mOnArtifactReady;
|
||||
ErrorCallback mOnError;
|
||||
};
|
||||
Reference in New Issue
Block a user