Пример #1
0
SchedulerCPU::ProducedCommands SchedulerCPU::ExecuteNode(GraphicsTask& task, std::optional<ProducedCommands>& inherited, const FrameContextEx& context) {
	// Inherit command list, if available.
	std::unique_ptr<BasicCommandList> inheritedCommandList;
	std::unique_ptr<VolatileViewHeap> inheritedVheap;
	if (inherited) {
		inheritedCommandList = std::move(inherited->list);
		inheritedVheap = std::move(inherited->vheap);
		inherited.reset();
	}

	// Execute given node.
	auto vheap = std::make_unique<VolatileViewHeap>(context.gxApi);
	RenderContext renderContext(context.memoryManager,
								context.textureSpace,
								context.shaderManager,
								context.gxApi,
								context.commandListPool,
								context.commandAllocatorPool,
								context.scratchSpacePool,
								std::move(inheritedCommandList),
								std::move(inheritedVheap));
	renderContext.SetCommandListName(typeid(task).name());
	task.Execute(renderContext);

	// Get inherited and current list, if any.
	std::unique_ptr<BasicCommandList> currentCommandList;
	std::unique_ptr<VolatileViewHeap> currentVheap;
	renderContext.Decompose(inheritedCommandList, currentCommandList, currentVheap);

	if (inheritedCommandList) {
		inherited = ProducedCommands{ std::move(inheritedCommandList), nullptr };
	}
	else {
		inherited.reset();
	}

	return { std::move(currentCommandList), std::move(currentVheap) };
}
Пример #2
0
 void reset() override
 {
     m_done_res.reset();
     m_operation->reset();
 }