hoping to get the point i am familiar with these two approaches:
Blocking the Game-Thread:
void AMyClass::Tick( float DeltaTime )
{
ENQUEUE_RENDER_COMMAND( DoDispatch ) ( [this] ( FRHICommandListImmediate& RHICmdList )
{
// ... RHI Compute-Shader Dispatch Stuff ...
} );
FlushRenderingCommands();
}
Not blocking the Game-Thread:
FThreadSafeBool bAsyncWorking = false;
void AMyClass::Tick( float DeltaTime )
{
if( bAsyncWorking == false )
{
bAsyncWorking = true;
ENQUEUE_RENDER_COMMAND( DoDispatch ) ( [this] ( FRHICommandListImmediate& RHICmdList )
{
// ... RHI Compute-Shader Dispatch Stuff ...
bAsyncWorking = false;
} );
}
}
Though i am not sure about the benefits of the RDG Render-Dependency-Graph in regards to basic compute-shader dispatching. (for UE5 i just adapted some code within the rendering-pipeline to match the RDG scheme).
@agreatworld would you recommend to use the RDG-system for Compute-Shader dispatches when resources depend on each other?