mirror of
https://github.com/AxioDL/boo.git
synced 2025-07-01 19:03:33 +00:00
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 void setDisplayGamma(float gamma) = 0;
|
||||||
virtual bool isTessellationSupported(uint32_t& maxPatchSizeOut) = 0;
|
virtual bool isTessellationSupported(uint32_t& maxPatchSizeOut) = 0;
|
||||||
virtual void waitUntilShadersReady() = 0;
|
virtual void waitUntilShadersReady() = 0;
|
||||||
|
virtual bool areShadersReady() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
using GraphicsDataFactoryContext = IGraphicsDataFactory::Context;
|
using GraphicsDataFactoryContext = IGraphicsDataFactory::Context;
|
||||||
|
@ -248,6 +248,10 @@ public:
|
|||||||
m_backcv.wait(lk, [this]() { return m_outstandingTasks == 0 || !m_running; });
|
m_backcv.wait(lk, [this]() { return m_outstandingTasks == 0 || !m_running; });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isReady() {
|
||||||
|
return m_outstandingTasks == 0 || !m_running;
|
||||||
|
}
|
||||||
|
|
||||||
PipelineCompileQueue() {
|
PipelineCompileQueue() {
|
||||||
unsigned int numThreads = std::thread::hardware_concurrency();
|
unsigned int numThreads = std::thread::hardware_concurrency();
|
||||||
if (numThreads > 1)
|
if (numThreads > 1)
|
||||||
|
@ -136,6 +136,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void waitUntilShadersReady() {}
|
void waitUntilShadersReady() {}
|
||||||
|
|
||||||
|
bool areShadersReady() { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
static const GLenum USE_TABLE[] = {GL_INVALID_ENUM, GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER, GL_UNIFORM_BUFFER};
|
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() {
|
void waitUntilShadersReady() {
|
||||||
m_pipelineQueue.waitUntilReady();
|
m_pipelineQueue.waitUntilReady();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool areShadersReady() {
|
||||||
|
return m_pipelineQueue.isReady();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline void ThrowIfFailed(VkResult res) {
|
static inline void ThrowIfFailed(VkResult res) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user