当前位置: 首页>>代码示例>>C++>>正文


C++ CommandBufferPtr::getImplementation方法代码示例

本文整理汇总了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
	}
}
开发者ID:galek,项目名称:anki-3d-engine-1,代码行数:26,代码来源:RenderingThread.cpp

示例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;
	}
开发者ID:Al1a123,项目名称:anki-3d-engine,代码行数:7,代码来源:CommandBuffer.cpp

示例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();
}
开发者ID:galek,项目名称:anki-3d-engine-1,代码行数:11,代码来源:Texture.cpp

示例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();
}
开发者ID:kingofoz,项目名称:anki-3d-engine,代码行数:11,代码来源:OcclusionQuery.cpp

示例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();
}
开发者ID:galek,项目名称:anki-3d-engine-1,代码行数:45,代码来源:RenderingThread.cpp


注:本文中的CommandBufferPtr::getImplementation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。