@@ -1960,7 +1960,7 @@ class GetDependantVisit<ICPUDescriptorSet> : public GetDependantVisitBase<ICPUDe
1960
1960
// the RLE will always finish a write because a single binding can only be a single descriptor type, important that the TLAS path happens after that check
1961
1961
if constexpr (std::is_same_v<DepType,ICPUTopLevelAccelerationStructure>)
1962
1962
{
1963
- deferredTLASWrites.push_back ({nullptr ,binding.data ,element,depObj. get () });
1963
+ deferredTLASWrites.push_back ({nullptr ,binding.data ,element,depObj});
1964
1964
return true ;
1965
1965
}
1966
1966
//
@@ -3586,11 +3586,9 @@ auto CAssetConverter::reserve(const SInputs& inputs) -> SReserveResult
3586
3586
auto & stagingCache = std::get<SReserveResult::staging_cache_t <AssetType>>(retval.m_stagingCaches );
3587
3587
phmap::erase_if (stagingCache,[](const auto & entry)->bool
3588
3588
{
3589
- if constexpr (std::is_same_v<AssetType,ICPUTopLevelAccelerationStructure>)
3590
- {
3591
- // TODO: gather into m_deferredTLASDescriptorWrites
3592
- }
3593
- return entry.first ->getReferenceCount ()==1 ;
3589
+ if (entry.first ->getReferenceCount ()==1 )
3590
+ return true ;
3591
+ return false ;
3594
3592
}
3595
3593
);
3596
3594
};
@@ -3608,19 +3606,20 @@ auto CAssetConverter::reserve(const SInputs& inputs) -> SReserveResult
3608
3606
pruneStaging.template operator ()<ICPUImageView>();
3609
3607
pruneStaging.template operator ()<ICPUBufferView>();
3610
3608
pruneStaging.template operator ()<ICPUImage>();
3611
- // need to nerf any writes to descriptor sets which don't exist anymore before checking the refcounts on them
3609
+ // because Descriptor Sets don't hold onto TLASes yet, we need to drop the TLASes in deferred descriptor writes
3612
3610
phmap::erase_if (retval.m_deferredTLASDescriptorWrites ,[&](const auto & entry)->bool
3613
3611
{
3614
3612
auto & dsStaging = std::get<SReserveResult::staging_cache_t <ICPUDescriptorSet>>(retval.m_stagingCaches );
3615
- return dsStaging.find (entry.dstSet )! =dsStaging.end ();
3613
+ return dsStaging.find (entry.dstSet )= =dsStaging.end ();
3616
3614
}
3617
3615
);
3618
3616
pruneStaging.template operator ()<ICPUTopLevelAccelerationStructure>();
3617
+ // go over
3619
3618
pruneStaging.template operator ()<ICPUBottomLevelAccelerationStructure>();
3620
3619
pruneStaging.template operator ()<ICPUBuffer>();
3621
3620
}
3622
3621
3623
- // TODO: defer the conversion requests until final objects are known (or knock them out) -> maybe change the conversion requests to unordered_map ?
3622
+ // TODO: prune the conversion requests -> maybe change the conversion requests to unordered_map ?
3624
3623
3625
3624
// TODO: only now get the queue flags
3626
3625
@@ -5249,7 +5248,7 @@ ISemaphore::future_t<IQueue::RESULT> CAssetConverter::convert_impl(SReserveResul
5249
5248
for (auto & inWrite : tlasWriteMap)
5250
5249
{
5251
5250
// I know what I'm doing, this member has no influence on the set key hash
5252
- auto tlas = core::smart_refctd_ptr<IGPUTopLevelAccelerationStructure>(const_cast <IGPUTopLevelAccelerationStructure*>(inWrite.tlas ));
5251
+ auto tlas = core::smart_refctd_ptr<IGPUTopLevelAccelerationStructure>(const_cast <IGPUTopLevelAccelerationStructure*>(inWrite.tlas . get () ));
5253
5252
assert (tlas);
5254
5253
if (missingDependent.template operator ()<ICPUTopLevelAccelerationStructure>(tlas.get ()))
5255
5254
continue ;
0 commit comments