@@ -965,34 +965,27 @@ class CAssetConverter : public core::IReferenceCounted
965965 inline uint64_t getMinASBuildScratchSize (const bool forHostOps) const
966966 {
967967 assert (m_minASBuildScratchSize[forHostOps]<=m_maxASBuildScratchSize[forHostOps]);
968- assert ((forHostOps ? willHostASBuild ():willDeviceASBuild ()) == (m_maxASBuildScratchSize[forHostOps]>0 ));
969968 return m_minASBuildScratchSize[forHostOps];
970969 }
971970 // Enough memory to build and compact all the Acceleration Structures at once, obviously respecting order of BLAS (build->compact) -> TLAS (build->compact)
972971 inline uint64_t getMaxASBuildScratchSize (const bool forHostOps) const
973972 {
974973 assert (m_minASBuildScratchSize[forHostOps]<=m_maxASBuildScratchSize[forHostOps]);
975- assert ((forHostOps ? willHostASBuild ():willDeviceASBuild ()) == (m_maxASBuildScratchSize[forHostOps]>0 ));
976974 return m_maxASBuildScratchSize[forHostOps];
977975 }
978- // What usage flags your scratch buffer must have, if returns NONE means are no Device AS Builds to perform.
979- inline auto getASBuildScratchUsages () const
980- {
981- assert ((m_ASBuildScratchUsages!=IGPUBuffer::E_USAGE_FLAGS::EUF_NONE)==willDeviceASBuild ());
982- return m_ASBuildScratchUsages;
983- }
984976 // tells you if you need to provide a valid `SConvertParams::scratchForDeviceASBuild`
985- inline bool willDeviceASBuild () const {return m_willDeviceBuildSomeAS ;}
977+ inline bool willDeviceASBuild () const {return getMinASBuildScratchSize ( false )> 0 ;}
986978 // tells you if you need to provide a valid `SConvertParams::scratchForHostASBuild`
987979 inline bool willHostASBuild () const
988980 {
989- assert (m_willHostBuildSomeAS==false ); // host builds not supported yet
990- return m_willHostBuildSomeAS;
981+ const bool retval = getMinASBuildScratchSize (true )>0 ;
982+ assert (!retval); // host builds not supported yet
983+ return retval;
991984 }
992985 // tells you if you need to provide a valid `SConvertParams::compactedASAllocator`
993986 inline bool willCompactAS () const
994987 {
995- assert (( willDeviceASBuild ()|| willHostASBuild ())==m_willCompactSomeAS );
988+ assert (!m_willCompactSomeAS || willDeviceASBuild () || willHostASBuild ());
996989 return m_willCompactSomeAS;
997990 }
998991
@@ -1089,11 +1082,7 @@ class CAssetConverter : public core::IReferenceCounted
10891082 // 0 for device builds, 1 for host builds
10901083 uint64_t m_minASBuildScratchSize[2 ] = {0 ,0 };
10911084 uint64_t m_maxASBuildScratchSize[2 ] = {0 ,0 };
1092- // is there even more than one usage needed?
1093- core::bitflag<IGPUBuffer::E_USAGE_FLAGS> m_ASBuildScratchUsages = IGPUBuffer::E_USAGE_FLAGS::EUF_NONE;
1094- // TODO: do we need those bools?
1095- uint8_t m_willDeviceBuildSomeAS : 1 = false ;
1096- uint8_t m_willHostBuildSomeAS : 1 = false ;
1085+ // We do all compactions on the Device for simplicity
10971086 uint8_t m_willCompactSomeAS : 1 = false ;
10981087
10991088 //
0 commit comments