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

Method apiSubresourceBarrier

Source/Falcor/Core/API/CopyContext.cpp:445–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

443}
444
445void CopyContext::apiSubresourceBarrier(
446 const Texture* pTexture,
447 Resource::State newState,
448 Resource::State oldState,
449 uint32_t arraySlice,
450 uint32_t mipLevel
451)
452{
453 auto resourceEncoder = getLowLevelData()->getResourceCommandEncoder();
454 auto subresourceState = pTexture->getSubresourceState(arraySlice, mipLevel);
455 if (subresourceState != newState)
456 {
457 gfx::ITextureResource* textureResource = pTexture->getGfxTextureResource();
458 gfx::SubresourceRange subresourceRange = {};
459 subresourceRange.baseArrayLayer = arraySlice;
460 subresourceRange.mipLevel = mipLevel;
461 subresourceRange.layerCount = 1;
462 subresourceRange.mipLevelCount = 1;
463 resourceEncoder->textureSubresourceBarrier(
464 textureResource, subresourceRange, getGFXResourceState(subresourceState), getGFXResourceState(newState)
465 );
466 mCommandsPending = true;
467 }
468}
469
470void CopyContext::uavBarrier(const Resource* pResource)
471{

Callers

nothing calls this directly

Calls 4

getLowLevelDataFunction · 0.85
getGFXResourceStateFunction · 0.85
getSubresourceStateMethod · 0.80

Tested by

no test coverage detected