mirror of https://github.com/AxioDL/boo.git
handy debug assert
This commit is contained in:
parent
916002f9da
commit
bb35ded399
|
@ -499,6 +499,12 @@ struct GLShaderDataBinding : IShaderDataBinding
|
||||||
std::unique_ptr<IGraphicsBuffer*[]> m_ubufs;
|
std::unique_ptr<IGraphicsBuffer*[]> m_ubufs;
|
||||||
size_t m_texCount;
|
size_t m_texCount;
|
||||||
std::unique_ptr<ITexture*[]> m_texs;
|
std::unique_ptr<ITexture*[]> m_texs;
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
/* Debugging aids */
|
||||||
|
bool m_committed = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
GLShaderDataBinding(IShaderPipeline* pipeline,
|
GLShaderDataBinding(IShaderPipeline* pipeline,
|
||||||
IVertexFormat* vtxFormat,
|
IVertexFormat* vtxFormat,
|
||||||
size_t ubufCount, IGraphicsBuffer** ubufs,
|
size_t ubufCount, IGraphicsBuffer** ubufs,
|
||||||
|
@ -517,6 +523,12 @@ struct GLShaderDataBinding : IShaderDataBinding
|
||||||
}
|
}
|
||||||
void bind(int b) const
|
void bind(int b) const
|
||||||
{
|
{
|
||||||
|
#ifndef NDEBUG
|
||||||
|
if (!m_committed)
|
||||||
|
Log.report(LogVisor::FatalError,
|
||||||
|
"attempted to use uncommitted GLShaderDataBinding");
|
||||||
|
#endif
|
||||||
|
|
||||||
GLuint prog = m_pipeline->bind();
|
GLuint prog = m_pipeline->bind();
|
||||||
m_vtxFormat->bind(b);
|
m_vtxFormat->bind(b);
|
||||||
for (size_t i=0 ; i<m_ubufCount ; ++i)
|
for (size_t i=0 ; i<m_ubufCount ; ++i)
|
||||||
|
@ -578,6 +590,8 @@ IGraphicsDataToken GLDataFactory::commit()
|
||||||
return IGraphicsDataToken(this, nullptr);
|
return IGraphicsDataToken(this, nullptr);
|
||||||
std::unique_lock<std::mutex> lk(m_committedMutex);
|
std::unique_lock<std::mutex> lk(m_committedMutex);
|
||||||
GLData* retval = m_deferredData;
|
GLData* retval = m_deferredData;
|
||||||
|
for (std::unique_ptr<GLShaderDataBinding>& b : retval->m_SBinds)
|
||||||
|
b->m_committed = true;
|
||||||
m_deferredData = nullptr;
|
m_deferredData = nullptr;
|
||||||
m_committedData.insert(retval);
|
m_committedData.insert(retval);
|
||||||
/* Let's go ahead and flush to ensure our data gets to the GPU
|
/* Let's go ahead and flush to ensure our data gets to the GPU
|
||||||
|
|
Loading…
Reference in New Issue