Commit be25334c by Philipp Adolf

Add timing code

parent 9ebd1676
...@@ -86,6 +86,10 @@ void Subdivision::subdivide(Mesh *mesh, int level) { ...@@ -86,6 +86,10 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
if (input.index_irregular_buffer.isEmpty()) { if (input.index_irregular_buffer.isEmpty()) {
// current_mesh->update(input.vb_handle, input.vertex_buffer, input.index_buffer, entry->indices_regular); // current_mesh->update(input.vb_handle, input.vertex_buffer, input.index_buffer, entry->indices_regular);
} else { } else {
QTime timer;
timer.start();
qCDebug(log_timing) << "subdivide started";
Tables tables = precomputeTables(input); Tables tables = precomputeTables(input);
Result result = runShader(input, tables); Result result = runShader(input, tables);
...@@ -116,6 +120,8 @@ void Subdivision::subdivide(Mesh *mesh, int level) { ...@@ -116,6 +120,8 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
qCDebug(log_subdiv) << "patches" << patches.length(); qCDebug(log_subdiv) << "patches" << patches.length();
current_mesh->update(result.vb_handle, result.vertex_buffer, result.vertex_buffer_irregular, irregular_ib, patches); current_mesh->update(result.vb_handle, result.vertex_buffer, result.vertex_buffer_irregular, irregular_ib, patches);
qCDebug(log_timing) << "subdivide done:" << formatTimeMeasurement(timer.elapsed());
} }
} }
...@@ -1019,6 +1025,10 @@ void Subdivision::runEdgeShader(GLuint size, GLuint vb_handle, GLuint edge_indic ...@@ -1019,6 +1025,10 @@ void Subdivision::runEdgeShader(GLuint size, GLuint vb_handle, GLuint edge_indic
} }
void Subdivision::updateIrregularForDraw(const QVector<Triangle> &triangles,QMap<Triangle, Triangle::Neighbors> &neighbors, Result &result){ void Subdivision::updateIrregularForDraw(const QVector<Triangle> &triangles,QMap<Triangle, Triangle::Neighbors> &neighbors, Result &result){
QTime timer;
timer.start();
qCDebug(log_timing) << "updateIrregularForDraw started";
result.vertex_buffer_irregular.resize(result.vertex_buffer.size()); result.vertex_buffer_irregular.resize(result.vertex_buffer.size());
QVectorIterator<Triangle> it(triangles); QVectorIterator<Triangle> it(triangles);
...@@ -1035,6 +1045,7 @@ void Subdivision::updateIrregularForDraw(const QVector<Triangle> &triangles,QMap ...@@ -1035,6 +1045,7 @@ void Subdivision::updateIrregularForDraw(const QVector<Triangle> &triangles,QMap
result.vertex_buffer_irregular[triangle.v_idx()].pos = updateIrregularVertexForDraw(triangle.v(), vertexNeighbors(triangle, ns.vw, neighbors)); result.vertex_buffer_irregular[triangle.v_idx()].pos = updateIrregularVertexForDraw(triangle.v(), vertexNeighbors(triangle, ns.vw, neighbors));
result.vertex_buffer_irregular[triangle.w_idx()].pos = updateIrregularVertexForDraw(triangle.w(), vertexNeighbors(triangle, ns.wu, neighbors)); result.vertex_buffer_irregular[triangle.w_idx()].pos = updateIrregularVertexForDraw(triangle.w(), vertexNeighbors(triangle, ns.wu, neighbors));
} }
qCDebug(log_timing) << "updateIrregularForDraw done:" << formatTimeMeasurement(timer.elapsed());
} }
bool Subdivision::containsVertex(QVector<Vertex> &vertices, Vertex vertex) { bool Subdivision::containsVertex(QVector<Vertex> &vertices, Vertex vertex) {
......
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