// Dispatches this shader. Can be called from any thread
static void Dispatch(
FnameOfTheShader9DispatchParams Params,
TFunction<void(int OutputVal)> AsyncCallback
)
{
if (IsInRenderingThread()) {
DispatchRenderThread(GetImmediateCommandList_ForRenderCommand(), Params, AsyncCallback);
}else{
DispatchGameThread(Params, AsyncCallback);
}
}
// Params struct used to pass args to our compute shader
FnameOfTheShader9DispatchParams Params(1, 1, 1);
// Fill in your input parameters here
Params.X = 123;
// Executes the compute shader and blocks until complete. You can place outputs in the params struct
FnameOfTheShader9Interface::Dispatch(Params);
It seems that dispatch need to take two arguments. May I know What should I write in the 2nd argument?