mirror of https://github.com/AxioDL/boo.git
Add areShadersReady poll function
This commit is contained in:
parent
e0674ff957
commit
8a181b96ce
|
@ -278,6 +278,7 @@ struct IGraphicsDataFactory {
|
|||
virtual void setDisplayGamma(float gamma) = 0;
|
||||
virtual bool isTessellationSupported(uint32_t& maxPatchSizeOut) = 0;
|
||||
virtual void waitUntilShadersReady() = 0;
|
||||
virtual bool areShadersReady() = 0;
|
||||
};
|
||||
|
||||
using GraphicsDataFactoryContext = IGraphicsDataFactory::Context;
|
||||
|
|
|
@ -248,6 +248,10 @@ public:
|
|||
m_backcv.wait(lk, [this]() { return m_outstandingTasks == 0 || !m_running; });
|
||||
}
|
||||
|
||||
bool isReady() {
|
||||
return m_outstandingTasks == 0 || !m_running;
|
||||
}
|
||||
|
||||
PipelineCompileQueue() {
|
||||
unsigned int numThreads = std::thread::hardware_concurrency();
|
||||
if (numThreads > 1)
|
||||
|
|
|
@ -136,6 +136,8 @@ public:
|
|||
}
|
||||
|
||||
void waitUntilShadersReady() {}
|
||||
|
||||
bool areShadersReady() { return true; }
|
||||
};
|
||||
|
||||
static const GLenum USE_TABLE[] = {GL_INVALID_ENUM, GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER, GL_UNIFORM_BUFFER};
|
||||
|
|
|
@ -147,6 +147,10 @@ public:
|
|||
void waitUntilShadersReady() {
|
||||
m_pipelineQueue.waitUntilReady();
|
||||
}
|
||||
|
||||
bool areShadersReady() {
|
||||
return m_pipelineQueue.isReady();
|
||||
}
|
||||
};
|
||||
|
||||
static inline void ThrowIfFailed(VkResult res) {
|
||||
|
|
Loading…
Reference in New Issue