Commit e28d3501 by Kai Westerkamp

Time format

parent 6c991eac
...@@ -13,6 +13,12 @@ Subdivision::~Subdivision() ...@@ -13,6 +13,12 @@ Subdivision::~Subdivision()
delete edgeShader; delete edgeShader;
} }
QString Subdivision::getTimeSting(int time){
return QString("%1m %2s %3ms").arg( time / 60000 , 2, 10, QChar('0'))
.arg((time % 60000) / 1000, 2, 10, QChar('0'))
.arg((time % 1000) , 3, 10, QChar('0'));
}
void Subdivision::init() { void Subdivision::init() {
QString source = QLatin1String(":/subdivision-edge.compute"); QString source = QLatin1String(":/subdivision-edge.compute");
edgeShader = initComputeShaderProgram(source); edgeShader = initComputeShaderProgram(source);
...@@ -383,7 +389,7 @@ void Subdivision::splitRegular(Mesh *mesh) { ...@@ -383,7 +389,7 @@ void Subdivision::splitRegular(Mesh *mesh) {
current_mesh->buffers[0]->updateIndices(); current_mesh->buffers[0]->updateIndices();
qCDebug(log_timing) << "splitRegular(mesh): time: " << totalTimer.elapsed()<<"ms"; qCDebug(log_timing) << "splitRegular(mesh): time: " <<getTimeSting(totalTimer.elapsed());
qCDebug(log_subdiv) << "splitRegular(mesh): regular: " << regular.length(); qCDebug(log_subdiv) << "splitRegular(mesh): regular: " << regular.length();
qCDebug(log_subdiv) << "splitRegular(mesh): irregular: " << irregular.length(); qCDebug(log_subdiv) << "splitRegular(mesh): irregular: " << irregular.length();
} }
...@@ -536,7 +542,7 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib_ ...@@ -536,7 +542,7 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib_
} }
} }
qCDebug(log_timing)<<"PatchIndexBuffer done:"<<totalTimer.elapsed()<<"ms"; qCDebug(log_timing)<<"PatchIndexBuffer done:"<<getTimeSting(totalTimer.elapsed());
return pib; return pib;
} }
...@@ -596,7 +602,7 @@ void Subdivision::findRegular(QVector<unsigned int> index_buffer, QVector<Vertex ...@@ -596,7 +602,7 @@ void Subdivision::findRegular(QVector<unsigned int> index_buffer, QVector<Vertex
irregular.push_back(index_buffer[i+2]); irregular.push_back(index_buffer[i+2]);
} }
} }
qCDebug(log_timing)<<"Find Regular done:"<<totalTimer.elapsed()<<"ms"; qCDebug(log_timing)<<"Find Regular done:"<<getTimeSting(totalTimer.elapsed());
} }
bool Subdivision::matchAndCompleteTriangleIndices(unsigned int sx, unsigned int sy, unsigned int sz, unsigned int tx, unsigned int ty, unsigned int &tz){ bool Subdivision::matchAndCompleteTriangleIndices(unsigned int sx, unsigned int sy, unsigned int sz, unsigned int tx, unsigned int ty, unsigned int &tz){
......
...@@ -48,6 +48,8 @@ private: ...@@ -48,6 +48,8 @@ private:
bool is_regular; bool is_regular;
}; };
QString getTimeSting(int time);
QOpenGLFunctions_4_3_Core *f; QOpenGLFunctions_4_3_Core *f;
QOpenGLShaderProgram *edgeShader; QOpenGLShaderProgram *edgeShader;
QOpenGLShaderProgram *vertexShader; QOpenGLShaderProgram *vertexShader;
......
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