Function dispatch

Synopsis

#include <Source/Falcor/Core/API/ComputeContext.h>

void dispatch(ComputeState *pState, ComputeVars *pVars, const uint3 &dispatchSize)

Description

Dispatch a compute task

Parameters:

[ in ] dispatchSize - 3D dispatch group size

Source

Lines 101-114 in Source/Falcor/Core/API/D3D12/D3D12ComputeContext.cpp. Line 52 in Source/Falcor/Core/API/ComputeContext.h.

void ComputeContext::dispatch(ComputeState* pState, ComputeVars* pVars, const uint3& dispatchSize)
{
    // Check dispatch dimensions. TODO: Should be moved into Falcor.
    if (dispatchSize.x > D3D12_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION ||
        dispatchSize.y > D3D12_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION ||
        dispatchSize.z > D3D12_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION)
    {
        logError("ComputePass::execute() - Dispatch dimension exceeds maximum. Skipping.");
        return;
    }
    if (prepareForDispatch(pState, pVars) == false) return;
    mpLowLevelData->getCommandList()->Dispatch(dispatchSize.x, dispatchSize.y, dispatchSize.z);
}





Add Discussion as Guest

Log in to DocsForge