Skip to content

Commit ef011fe

Browse files
author
devsh
committed
swap out compacted AS in the output
1 parent 6c74d70 commit ef011fe

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/nbl/video/utilities/CAssetConverter.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4710,6 +4710,13 @@ if (worstSize>minScratchSize)
47104710
// modify the ownership release
47114711
if (const auto ix=compactedOwnershipReleaseIndices[i]; ix<ownershipTransfers.size())
47124712
ownershipTransfers[ix].range = compactedAS->getCreationParams().bufferRange;
4713+
// swap out the conversion result
4714+
const auto foundIx = outputReverseMap.find(as);
4715+
if (foundIx!=outputReverseMap.end())
4716+
{
4717+
auto& resultOutput = std::get<SReserveResult::vector_t<ICPUTopLevelAccelerationStructure>>(reservations.m_gpuObjects);
4718+
resultOutput[foundIx->second].value = compactedAS;
4719+
}
47134720
// insert into compaction map
47144721
compactedTLASMap[as] = std::move(compactedAS);
47154722
}
@@ -4880,6 +4887,7 @@ if (worstSize>minScratchSize)
48804887
item.second.value = {};
48814888
continue;
48824889
}
4890+
// TODO: we could just hotswap the `pGpuObj` in staging and write it to Descriptor Set here instead
48834891
// The BLASes don't need to do this, because no-one checks for them as dependents and we can substitute the `item.first` in the staging cache right away
48844892
// For TLASes we need to write the compacted TLAS and not the intermediate build to the Cache
48854893
if constexpr (IsTLAS)
@@ -4914,6 +4922,7 @@ if (worstSize>minScratchSize)
49144922
mergeCache.operator()<ICPURenderpass>();
49154923
mergeCache.operator()<ICPUGraphicsPipeline>();
49164924
mergeCache.operator()<ICPUDescriptorSet>();
4925+
// TODO: should be done during `mergeCache.operator()<ICPUDescriptorSet>`
49174926
// deal with rewriting the TLASes with compacted ones
49184927
{
49194928
// not strictly necessary, just provoking refcounting bugs right away if they exist

0 commit comments

Comments
 (0)