本文整理汇总了C++中CommandBufferPtr::getImplementation方法的典型用法代码示例。如果您正苦于以下问题:C++ CommandBufferPtr::getImplementation方法的具体用法?C++ CommandBufferPtr::getImplementation怎么用?C++ CommandBufferPtr::getImplementation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommandBufferPtr
的用法示例。
在下文中一共展示了CommandBufferPtr::getImplementation方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: flushCommandBuffer
//==============================================================================
void RenderingThread::flushCommandBuffer(CommandBufferPtr cmdb)
{
cmdb->getImplementation().makeImmutable();
{
LockGuard<Mutex> lock(m_mtx);
// Set commands
U64 diff = m_tail - m_head;
if(diff < m_queue.getSize())
{
U64 idx = m_tail % m_queue.getSize();
m_queue[idx] = cmdb;
++m_tail;
}
else
{
ANKI_LOGW("Rendering queue too small");
}
m_condVar.notifyOne(); // Wake the thread
}
}
示例2: operator
Error operator()(GlState&)
{
ANKI_TRACE_START_EVENT(GL_2ND_LEVEL_CMD_BUFFER);
Error err = m_cmdb->getImplementation().executeAllCommands();
ANKI_TRACE_STOP_EVENT(GL_2ND_LEVEL_CMD_BUFFER);
return err;
}
示例3: init
void Texture::init(const TextureInitInfo& init)
{
m_impl.reset(getAllocator().newInstance<TextureImpl>(&getManager()));
CommandBufferPtr cmdb =
getManager().newInstance<CommandBuffer>(CommandBufferInitInfo());
cmdb->getImplementation().pushBackNewCommand<CreateTextureCommand>(
this, init);
cmdb->flush();
}
示例4: init
void OcclusionQuery::init(OcclusionQueryResultBit condRenderingBit)
{
m_impl.reset(getAllocator().newInstance<OcclusionQueryImpl>(&getManager()));
CommandBufferPtr cmdb =
getManager().newInstance<CommandBuffer>(CommandBufferInitInfo());
cmdb->getImplementation().pushBackNewCommand<CreateOqCommand>(
this, condRenderingBit);
cmdb->flush();
}
示例5: threadLoop
//==============================================================================
void RenderingThread::threadLoop()
{
prepare();
while(1)
{
CommandBufferPtr cmd;
// Wait for something
{
LockGuard<Mutex> lock(m_mtx);
while(m_tail == m_head)
{
m_condVar.wait(m_mtx);
}
// Check signals
if(m_renderingThreadSignal == 1)
{
// Requested to stop
break;
}
U64 idx = m_head % m_queue.getSize();
// Pop a command
cmd = m_queue[idx];
m_queue[idx] = CommandBufferPtr(); // Insert empty cmd buffer
++m_head;
}
ANKI_TRACE_START_EVENT(GL_THREAD);
Error err = cmd->getImplementation().executeAllCommands();
ANKI_TRACE_STOP_EVENT(GL_THREAD);
if(err)
{
ANKI_LOGE("Error in rendering thread. Aborting");
abort();
}
}
finish();
}