MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / resolveResource

Method resolveResource

Source/Falcor/Core/API/RenderContext.cpp:575–608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

573}
574
575void RenderContext::resolveResource(const ref<Texture>& pSrc, const ref<Texture>& pDst)
576{
577 FALCOR_CHECK(pSrc->getType() == Resource::Type::Texture2DMultisample, "Source texture must be multi-sampled.");
578 FALCOR_CHECK(pDst->getType() == Resource::Type::Texture2D, "Destination texture must not be multi-sampled.");
579 FALCOR_CHECK(pSrc->getFormat() == pDst->getFormat(), "Source and destination textures must have the same format.");
580 FALCOR_CHECK(
581 pSrc->getWidth() == pDst->getWidth() && pSrc->getHeight() == pDst->getHeight(),
582 "Source and destination textures must have the same dimensions."
583 );
584 FALCOR_CHECK(pSrc->getArraySize() == pDst->getArraySize(), "Source and destination textures must have the same array size.");
585 FALCOR_CHECK(pSrc->getMipCount() == pDst->getMipCount(), "Source and destination textures must have the same mip count.");
586
587 resourceBarrier(pSrc.get(), Resource::State::ResolveSource);
588 resourceBarrier(pDst.get(), Resource::State::ResolveDest);
589
590 auto resourceEncoder = getLowLevelData()->getResourceCommandEncoder();
591
592 gfx::SubresourceRange srcRange = {};
593 srcRange.layerCount = pSrc->getArraySize();
594 srcRange.mipLevelCount = pSrc->getMipCount();
595 gfx::SubresourceRange dstRange = {};
596 dstRange.layerCount = pDst->getArraySize();
597 dstRange.mipLevelCount = pDst->getMipCount();
598
599 resourceEncoder->resolveResource(
600 pSrc->getGfxTextureResource(),
601 gfx::ResourceState::ResolveSource,
602 srcRange,
603 pDst->getGfxTextureResource(),
604 gfx::ResourceState::ResolveDestination,
605 dstRange
606 );
607 mCommandsPending = true;
608}
609
610void RenderContext::buildAccelerationStructure(
611 const RtAccelerationStructure::BuildDesc& desc,

Callers 3

executeMethod · 0.80
resolveSubresourceMethod · 0.80
onFrameRenderMethod · 0.80

Calls 7

getLowLevelDataFunction · 0.85
getFormatMethod · 0.80
getWidthMethod · 0.80
getHeightMethod · 0.80
getTypeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected