Shader ownership change
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "RenderCadenceClock.h"
|
||||
#include "../runtime/RuntimeSlangShaderCompiler.h"
|
||||
#include "../runtime/RuntimeShaderArtifact.h"
|
||||
#include "RuntimeShaderRenderer.h"
|
||||
|
||||
#include <atomic>
|
||||
@@ -44,6 +44,7 @@ public:
|
||||
|
||||
bool Start(std::string& error);
|
||||
void Stop();
|
||||
void SubmitRuntimeShaderArtifact(const RuntimeShaderArtifact& artifact);
|
||||
|
||||
Metrics GetMetrics() const;
|
||||
bool IsRunning() const { return mRunning.load(std::memory_order_acquire); }
|
||||
@@ -56,10 +57,10 @@ private:
|
||||
void CountCompleted();
|
||||
void CountAcquireMiss();
|
||||
void TryCommitReadyRuntimeShader(RuntimeShaderRenderer& runtimeShaderRenderer);
|
||||
bool TryTakePendingRuntimeShaderArtifact(RuntimeShaderArtifact& artifact);
|
||||
|
||||
SystemFrameExchange& mFrameExchange;
|
||||
Config mConfig;
|
||||
RuntimeSlangShaderCompiler mSlangCompiler;
|
||||
std::thread mThread;
|
||||
std::atomic<bool> mStopping{ false };
|
||||
std::atomic<bool> mRunning{ false };
|
||||
@@ -71,4 +72,8 @@ private:
|
||||
|
||||
mutable std::mutex mMetricsMutex;
|
||||
Metrics mMetrics;
|
||||
|
||||
std::mutex mShaderArtifactMutex;
|
||||
bool mHasPendingShaderArtifact = false;
|
||||
RuntimeShaderArtifact mPendingShaderArtifact;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user