Add build time to cpublasinfo
This commit is contained in:
parent
82e748cb49
commit
e0a7e2e8cc
2 changed files with 11 additions and 2 deletions
|
|
@ -359,7 +359,7 @@ void CPUAccelStruct::PrintStats()
|
|||
{
|
||||
if (DynamicBLAS[i])
|
||||
{
|
||||
Printf("#%d avg=%2.3f balanced=%2.3f\n", (int)i, (double)DynamicBLAS[i]->GetAverageDepth(), (double)DynamicBLAS[i]->GetBalancedDepth());
|
||||
Printf("#%d avg=%2.3f balanced=%2.3f nodes=%d buildtime=%2.3f ms\n", (int)i, (double)DynamicBLAS[i]->GetAverageDepth(), (double)DynamicBLAS[i]->GetBalancedDepth(), (int)DynamicBLAS[i]->GetNodes().size(), DynamicBLAS[i]->GetBuildTimeMS());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -377,6 +377,9 @@ CPUBottomLevelAccelStruct::CPUBottomLevelAccelStruct(const FFlatVertex *vertices
|
|||
if (num_triangles <= 0)
|
||||
return;
|
||||
|
||||
cycle_t timer;
|
||||
timer.ResetAndClock();
|
||||
|
||||
scratch.leafs.clear();
|
||||
scratch.leafs.reserve(num_triangles);
|
||||
scratch.centroids.clear();
|
||||
|
|
@ -401,7 +404,10 @@ CPUBottomLevelAccelStruct::CPUBottomLevelAccelStruct(const FFlatVertex *vertices
|
|||
if (scratch.workbuffer.size() < neededbuffersize)
|
||||
scratch.workbuffer.resize(neededbuffersize);
|
||||
|
||||
root = Subdivide(&scratch.leafs[0], (int)scratch.leafs.size(), scratch.centroids.data(), scratch.workbuffer.data());
|
||||
root = Subdivide(scratch.leafs.data(), (int)scratch.leafs.size(), scratch.centroids.data(), scratch.workbuffer.data());
|
||||
|
||||
timer.Unclock();
|
||||
buildtime = timer.TimeMS();
|
||||
}
|
||||
|
||||
TraceHit CPUBottomLevelAccelStruct::FindFirstHit(const FVector3 &ray_start, const FVector3 &ray_end)
|
||||
|
|
|
|||
|
|
@ -154,6 +154,7 @@ public:
|
|||
int GetMaxDepth() const;
|
||||
float GetAverageDepth() const;
|
||||
float GetBalancedDepth() const;
|
||||
double GetBuildTimeMS() const { return buildtime; }
|
||||
|
||||
const CollisionBBox &GetBBox() const { return nodes[root].aabb; }
|
||||
|
||||
|
|
@ -185,6 +186,8 @@ private:
|
|||
std::vector<Node> nodes;
|
||||
int root = -1;
|
||||
|
||||
double buildtime = 0.0;
|
||||
|
||||
void FindFirstHit(const RayBBox& ray, int a, TraceHit* hit);
|
||||
float IntersectTriangleRay(const RayBBox &ray, int a, float &barycentricB, float &barycentricC);
|
||||
int Subdivide(int *triangles, int num_triangles, const FVector4 *centroids, int *work_buffer);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue