dispatch event intergration
All checks were successful
CI / React UI Build (push) Successful in 11s
CI / Native Windows Build And Tests (push) Successful in 2m28s
CI / Windows Release Package (push) Successful in 2m24s

This commit is contained in:
Aiden
2026-05-11 15:42:14 +10:00
parent ccfc0237fd
commit a9b08f7f27
16 changed files with 785 additions and 59 deletions

View File

@@ -10,6 +10,8 @@
#include <thread>
#include <vector>
class RuntimeEventDispatcher;
struct PreparedLayerShader
{
RuntimeRenderState state;
@@ -28,7 +30,7 @@ struct PreparedShaderBuild
class ShaderBuildQueue
{
public:
explicit ShaderBuildQueue(RuntimeSnapshotProvider& runtimeSnapshotProvider);
ShaderBuildQueue(RuntimeSnapshotProvider& runtimeSnapshotProvider, RuntimeEventDispatcher& runtimeEventDispatcher);
~ShaderBuildQueue();
ShaderBuildQueue(const ShaderBuildQueue&) = delete;
@@ -36,13 +38,16 @@ public:
void RequestBuild(unsigned outputWidth, unsigned outputHeight);
bool TryConsumeReadyBuild(PreparedShaderBuild& build);
bool TryConsumeReadyBuild(uint64_t expectedGeneration, PreparedShaderBuild& build);
void Stop();
private:
void WorkerLoop();
PreparedShaderBuild Build(uint64_t generation, unsigned outputWidth, unsigned outputHeight);
void PublishBuildLifecycleEvent(const PreparedShaderBuild& build, unsigned outputWidth, unsigned outputHeight) const;
RuntimeSnapshotProvider& mRuntimeSnapshotProvider;
RuntimeEventDispatcher& mRuntimeEventDispatcher;
std::thread mWorkerThread;
std::mutex mMutex;
std::condition_variable mCondition;