@@ -2118,6 +2118,9 @@ class GetDependantVisit<ICPUPolygonGeometry> : public GetDependantVisitBase<ICPU
2118
2118
}
2119
2119
2120
2120
IGPUPolygonGeometry::SCreationParams creationParams = {};
2121
+ // has to be public because of aggregate init, but its only for internal usage!
2122
+ core::vector<IGPUPolygonGeometry::SJointWeight> jointWeightViews = {};
2123
+ core::vector<IGPUPolygonGeometry::SDataView> auxAttributeViews = {};
2121
2124
2122
2125
protected:
2123
2126
bool descend_impl (
@@ -2180,9 +2183,6 @@ class GetDependantVisit<ICPUPolygonGeometry> : public GetDependantVisitBase<ICPU
2180
2183
creationParams.indexing = nullptr ;
2181
2184
return retval;
2182
2185
}
2183
-
2184
- core::vector<IGPUPolygonGeometry::SJointWeight> jointWeightViews;
2185
- core::vector<IGPUPolygonGeometry::SDataView> auxAttributeViews;
2186
2186
};
2187
2187
2188
2188
@@ -2656,7 +2656,8 @@ struct conversions_t
2656
2656
return ;
2657
2657
}
2658
2658
// set debug names on everything!
2659
- setDebugName (conv,output->get (),contentHash,uniqueCopyGroupID);
2659
+ if constexpr (std::is_base_of_v<IBackendObject,typename asset_traits<AssetType>::video_t >)
2660
+ setDebugName (conv,output->get (),contentHash,uniqueCopyGroupID);
2660
2661
}
2661
2662
2662
2663
// Since the dfsCache has the original asset pointers as keys, we map in reverse (multiple `instance_t` can map to the same unique content hash and GPU object)
@@ -3885,6 +3886,11 @@ auto CAssetConverter::reserve(const SInputs& inputs) -> SReserveResult
3885
3886
return retval;
3886
3887
}
3887
3888
3889
+
3890
+ // Maps GPU Object back to the output array index
3891
+ template <asset::Asset AssetType>
3892
+ using reverse_map_t = core::unordered_map<const typename asset_traits<AssetType>::video_t *,uint32_t >;
3893
+
3888
3894
//
3889
3895
ISemaphore::future_t <IQueue::RESULT> CAssetConverter::convert_impl (SReserveResult& reservations, SConvertParams& params)
3890
3896
{
@@ -3926,16 +3932,20 @@ ISemaphore::future_t<IQueue::RESULT> CAssetConverter::convert_impl(SReserveResul
3926
3932
};
3927
3933
3928
3934
// wipe gpu item in staging cache (this may drop it as well if it was made for only a root asset == no users)
3929
- core::unordered_map< const IBackendObject*, uint32_t > outputReverseMap ;
3930
- core::for_each_in_tuple (reservations.m_gpuObjects ,[&outputReverseMap ](const auto & gpuObjects)->void
3935
+ core::tuple_transform_t < reverse_map_t ,supported_asset_types> outputReverseMaps ;
3936
+ core::for_each_in_tuple (reservations.m_gpuObjects ,[&outputReverseMaps ](const auto & gpuObjects)->void
3931
3937
{
3932
3938
uint32_t i = 0 ;
3933
3939
for (const auto & gpuObj : gpuObjects)
3934
- outputReverseMap[gpuObj.value .get ()] = i++;
3940
+ {
3941
+ const auto * ptr = gpuObj.value .get ();
3942
+ std::get<core::unordered_map<decltype (ptr),uint32_t >>(outputReverseMaps)[ptr] = i++;
3943
+ }
3935
3944
}
3936
3945
);
3937
- auto markFailure = [&reservations,&outputReverseMap ,logger]<Asset AssetType>(const char * message, smart_refctd_ptr<const AssetType>* canonical, typename SReserveResult::staging_cache_t <AssetType>::mapped_type* cacheNode)->void
3946
+ auto markFailure = [&reservations,&outputReverseMaps ,logger]<Asset AssetType>(const char * message, smart_refctd_ptr<const AssetType>* canonical, typename SReserveResult::staging_cache_t <AssetType>::mapped_type* cacheNode)->void
3938
3947
{
3948
+ auto & outputReverseMap = std::get<reverse_map_t <AssetType>>(outputReverseMaps);
3939
3949
// wipe the smart pointer to the canonical, make sure we release that memory ASAP if no other user is around
3940
3950
*canonical = nullptr ;
3941
3951
// also drop the smart pointer from the output array so failures release memory quickly
@@ -5499,6 +5509,7 @@ ISemaphore::future_t<IQueue::RESULT> CAssetConverter::convert_impl(SReserveResul
5499
5509
if (const auto ix=compactedOwnershipReleaseIndices[i]; ix<ownershipTransfers.size ())
5500
5510
ownershipTransfers[ix].range = compactedAS->getCreationParams ().bufferRange ;
5501
5511
// swap out the conversion result
5512
+ auto & outputReverseMap = std::get<reverse_map_t <CPUAccelerationStructure>>(outputReverseMaps);
5502
5513
const auto foundIx = outputReverseMap.find (srcAS);
5503
5514
if (foundIx!=outputReverseMap.end ())
5504
5515
{
@@ -5659,7 +5670,7 @@ ISemaphore::future_t<IQueue::RESULT> CAssetConverter::convert_impl(SReserveResul
5659
5670
return ;
5660
5671
depsMissing = missingDependent.template operator ()<ICPUBuffer>(view.src .buffer .get ());
5661
5672
};
5662
- if (const auto * view=pGPUObj ->getJointOBBView (); view)
5673
+ if (const auto * view=pGpuObj ->getJointOBBView (); view)
5663
5674
checkView (*view);
5664
5675
checkView (pGpuObj->getIndexView ());
5665
5676
checkView (pGpuObj->getNormalView ());
0 commit comments