@@ -965,34 +965,27 @@ class CAssetConverter : public core::IReferenceCounted
965
965
inline uint64_t getMinASBuildScratchSize (const bool forHostOps) const
966
966
{
967
967
assert (m_minASBuildScratchSize[forHostOps]<=m_maxASBuildScratchSize[forHostOps]);
968
- assert ((forHostOps ? willHostASBuild ():willDeviceASBuild ()) == (m_maxASBuildScratchSize[forHostOps]>0 ));
969
968
return m_minASBuildScratchSize[forHostOps];
970
969
}
971
970
// Enough memory to build and compact all the Acceleration Structures at once, obviously respecting order of BLAS (build->compact) -> TLAS (build->compact)
972
971
inline uint64_t getMaxASBuildScratchSize (const bool forHostOps) const
973
972
{
974
973
assert (m_minASBuildScratchSize[forHostOps]<=m_maxASBuildScratchSize[forHostOps]);
975
- assert ((forHostOps ? willHostASBuild ():willDeviceASBuild ()) == (m_maxASBuildScratchSize[forHostOps]>0 ));
976
974
return m_maxASBuildScratchSize[forHostOps];
977
975
}
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
- }
984
976
// 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 ;}
986
978
// tells you if you need to provide a valid `SConvertParams::scratchForHostASBuild`
987
979
inline bool willHostASBuild () const
988
980
{
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;
991
984
}
992
985
// tells you if you need to provide a valid `SConvertParams::compactedASAllocator`
993
986
inline bool willCompactAS () const
994
987
{
995
- assert (( willDeviceASBuild ()|| willHostASBuild ())==m_willCompactSomeAS );
988
+ assert (!m_willCompactSomeAS || willDeviceASBuild () || willHostASBuild ());
996
989
return m_willCompactSomeAS;
997
990
}
998
991
@@ -1089,11 +1082,7 @@ class CAssetConverter : public core::IReferenceCounted
1089
1082
// 0 for device builds, 1 for host builds
1090
1083
uint64_t m_minASBuildScratchSize[2 ] = {0 ,0 };
1091
1084
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
1097
1086
uint8_t m_willCompactSomeAS : 1 = false ;
1098
1087
1099
1088
//
0 commit comments