Function uavBarrier

Synopsis

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

void uavBarrier(const Resource *pResource)

Description

Insert a UAV barrier

Source

Lines 265-277 in Source/Falcor/Core/API/D3D12/D3D12CopyContext.cpp. Line 91 in Source/Falcor/Core/API/CopyContext.h.

void CopyContext::uavBarrier(const Resource* pResource)
{
    D3D12_RESOURCE_BARRIER barrier;
    barrier.Type = D3D12_RESOURCE_BARRIER_TYPE_UAV;
    barrier.Flags = D3D12_RESOURCE_BARRIER_FLAG_NONE;
    barrier.UAV.pResource = pResource->getApiHandle();
    // Check that resource has required bind flags for UAV barrier to be supported
    static const Resource::BindFlags reqFlags = Resource::BindFlags::UnorderedAccess | Resource::BindFlags::AccelerationStructure;
    assert(is_set(pResource->getBindFlags(), reqFlags));
    mpLowLevelData->getCommandList()->ResourceBarrier(1, &barrier);
    mCommandsPending = true;
}





Add Discussion as Guest

Log in to DocsForge