| 573 | } |
| 574 | |
| 575 | void 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 | |
| 610 | void RenderContext::buildAccelerationStructure( |
| 611 | const RtAccelerationStructure::BuildDesc& desc, |
no test coverage detected