namespace ENamedThreads
{
CORE_API Type RenderThread = ENamedThreads::GameThread; // defaults to game and is set and reset by the render thread itself
CORE_API Type RenderThread_Local = ENamedThreads::GameThread_Local; // defaults to game local and is set and reset by the render thread itself
}
渲染线程维护两个队列,一个是主线程发送给渲染线程的RenderThread队列,
还有一个RenderThread_Local队列,使用方法大概类似于这样:
// We need to do this on the render thread
FRHICommandList* CmdList = new FRHICommandList;
CmdList->CopyRenderThreadContexts(RHICmdList);
FGraphEventRef RenderThreadCompletionEvent = TGraphTask<FSetGlobalBoundShaderStateRenderThreadTask>::CreateTask().ConstructAndDispatchWhenReady(*CmdList, GlobalBoundShaderState, FeatureLevel);
RHICmdList.QueueRenderThreadCommandListSubmit(RenderThreadCompletionEvent, CmdList);
RenderThread_Local队列