Skip to content

Commit 4eef9f9

Browse files
author
devsh
committed
get assetConverter to work on IGPUPolygonGeometry
1 parent 1403f33 commit 4eef9f9

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

include/nbl/asset/IGeometry.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,5 +406,21 @@ class IIndexableGeometry : public IGeometry<BufferType>
406406
SDataView m_indexView = {};
407407
};
408408

409+
}
410+
411+
//
412+
namespace nbl::core
413+
{
414+
template<typename Dummy>
415+
struct blake3_hasher::update_impl<asset::IGeometryBase::SDataViewBase,Dummy>
416+
{
417+
static inline void __call(blake3_hasher& hasher, const asset::IGeometryBase::SDataViewBase& input)
418+
{
419+
hasher << input.stride;
420+
hasher << input.format;
421+
hasher << input.rangeFormat;
422+
input.visitAABB([&hasher](auto& aabb)->void{hasher.update(&aabb,sizeof(aabb));});
423+
}
424+
};
409425
}
410426
#endif

src/nbl/video/utilities/CAssetConverter.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ class AssetVisitor : public CRTP
741741
const auto* geo = instance.asset;
742742
if (!geo->valid())
743743
return false;
744-
auto visit = [](const IGeometry<ICPUBuffer>::SDataView& view, const core::bitflag<IGPUBuffer::E_USAGE_FLAGS>& extraUsages, const EPolygonGeometryViewType type, const uint32_t index=0)->bool
744+
auto visit = [&](const IGeometry<ICPUBuffer>::SDataView& view, const core::bitflag<IGPUBuffer::E_USAGE_FLAGS>& extraUsages, const EPolygonGeometryViewType type, const uint32_t index=0)->bool
745745
{
746746
if (!view)
747747
return true;
@@ -3956,7 +3956,14 @@ ISemaphore::future_t<IQueue::RESULT> CAssetConverter::convert_impl(SReserveResul
39563956
resultOutput[foundIx->second].value = nullptr;
39573957
outputReverseMap.erase(foundIx);
39583958
}
3959-
logger.log("%s failed for \"%s\"",system::ILogger::ELL_ERROR,message,cacheNode->gpuRef->getObjectDebugName());
3959+
const char* name = "[Debug Name Unknown because not descended from IBackendObject]";
3960+
if constexpr (std::is_base_of_v<IBackendObject,typename asset_traits<AssetType>::video_t>)
3961+
name = cacheNode->gpuRef->getObjectDebugName();
3962+
else
3963+
{
3964+
// TODO: get name from hash in cacheNode->cacheKey
3965+
}
3966+
logger.log("%s failed for \"%s\"",system::ILogger::ELL_ERROR,message,name);
39603967
// drop smart pointer
39613968
cacheNode->gpuRef = nullptr;
39623969
};

0 commit comments

Comments
 (0)