Commit 6cf6fd52 by Philipp Adolf

Add timing to precomputeTables

parent 2d28fda0
...@@ -153,6 +153,8 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) { ...@@ -153,6 +153,8 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
QVector<Vertex> vb = input.vertex_buffer; QVector<Vertex> vb = input.vertex_buffer;
qCDebug(log_subdiv_trace) << "Vertex Buffer: " << vb; qCDebug(log_subdiv_trace) << "Vertex Buffer: " << vb;
QTime trianglesTimer;
trianglesTimer.start();
QVector<Triangle> triangles; QVector<Triangle> triangles;
for (int i = 0; i < ib.length(); i+=3) { for (int i = 0; i < ib.length(); i+=3) {
triangles.push_back(Triangle(&vb, ib[i], ib[i+1], ib[i+2])); triangles.push_back(Triangle(&vb, ib[i], ib[i+1], ib[i+2]));
...@@ -161,9 +163,17 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) { ...@@ -161,9 +163,17 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
for (int i = 0; i < ib_regular.length(); i+=3) { for (int i = 0; i < ib_regular.length(); i+=3) {
triangles.push_back(Triangle(&vb, ib_regular[i], ib_regular[i+1], ib_regular[i+2])); triangles.push_back(Triangle(&vb, ib_regular[i], ib_regular[i+1], ib_regular[i+2]));
} }
qCDebug(log_timing) << "building Triangles:" << getTimeSting(trianglesTimer.elapsed());
QTime subTimer;
subTimer.start();
precomputeEdgeTable(tables, triangles, triangles_regular, (unsigned int) vb.length()); precomputeEdgeTable(tables, triangles, triangles_regular, (unsigned int) vb.length());
qCDebug(log_timing) << "precomputeEdgeTable:" << getTimeSting(subTimer.elapsed());
subTimer.restart();
precomputeVertexTable(tables, vb, ib, ib_regular); precomputeVertexTable(tables, vb, ib, ib_regular);
qCDebug(log_timing) << "precomputeVertexTable:" << getTimeSting(subTimer.elapsed());
//tables.patch_index_regular = getPatchIndexBuffer(ib, QVector<unsigned int>());//TODO pass regular and irregular index buffer? //tables.patch_index_regular = getPatchIndexBuffer(ib, QVector<unsigned int>());//TODO pass regular and irregular index buffer?
qCDebug(log_subdiv) << "Precompute Tables Done"; qCDebug(log_subdiv) << "Precompute Tables Done";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment