Function copySubresource

Synopsis

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

void copySubresource(const Texture *pDst, uint32_t dstSubresourceIdx, const Texture *pSrc, uint32_t srcSubresourceIdx)

Description

Copy a subresource

Source

Lines 287-305 in Source/Falcor/Core/API/D3D12/D3D12CopyContext.cpp. Line 99 in Source/Falcor/Core/API/CopyContext.h.

void CopyContext::copySubresource(const Texture* pDst, uint32_t dstSubresourceIdx, const Texture* pSrc, uint32_t srcSubresourceIdx)
{
    resourceBarrier(pDst, Resource::State::CopyDest);
    resourceBarrier(pSrc, Resource::State::CopySource);
    D3D12_TEXTURE_COPY_LOCATION pSrcCopyLoc;
    D3D12_TEXTURE_COPY_LOCATION pDstCopyLoc;
    pDstCopyLoc.pResource = pDst->getApiHandle();
    pDstCopyLoc.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
    pDstCopyLoc.SubresourceIndex = dstSubresourceIdx;
    pSrcCopyLoc.pResource = pSrc->getApiHandle();
    pSrcCopyLoc.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
    pSrcCopyLoc.SubresourceIndex = srcSubresourceIdx;
    mpLowLevelData->getCommandList()->CopyTextureRegion(&pDstCopyLoc, 0, 0, 0, &pSrcCopyLoc, NULL);
    mCommandsPending = true;
}





Add Discussion as Guest

Log in to DocsForge