我在微软的示例中发现:
void D3D12HelloTriangle::OnRender()
{
// Record all the commands we need to render the scene into the command list.
PopulateCommandList();
// Execute the command list.
ID3D12CommandList* ppCommandLists[] = { m_commandList.Get() };
m_commandQueue->ExecuteCommandLists(_countof(ppCommandLists), ppCommandLists);
// Present the frame.
ThrowIfFailed(m_swapChain->Present(1, 0));
WaitForPreviousFrame();
}
实际上是如何运作的? ExecuteCommandLists 是一个异步函数调用,因此这意味着代码将继续执行并命中 Present 函数。
当前通话后会发生什么?比方说,GPU 仍在绘图、工作并存在被调用。 Present是同步调用吗?当 GPU 仍在绘图时,它无法呈现缓冲区。那是对的吗 ?有人可以解释一下这里发生了什么吗?
Present 也是一个异步命令,告诉 GPU 开始从交换链中的下一个缓冲区扫描(显示)。您不必担心 GPU 在“翻转”发生之前尚未完成执行所有先前发出的工作(在图形命令队列上)。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)