Commit f4a2cb8f by Philipp Adolf

Add subdiv.trace logging category

To be used for long lists that aren't interesting most of the time.
parent 1cf5a9f8
#include "logcategories.h" #include "logcategories.h"
Q_LOGGING_CATEGORY(log_subdiv, "subdiv") Q_LOGGING_CATEGORY(log_subdiv, "subdiv")
Q_LOGGING_CATEGORY(log_subdiv_trace, "subdiv.trace")
Q_LOGGING_CATEGORY(log_mesh, "mesh") Q_LOGGING_CATEGORY(log_mesh, "mesh")
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <QLoggingCategory> #include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(log_subdiv) Q_DECLARE_LOGGING_CATEGORY(log_subdiv)
Q_DECLARE_LOGGING_CATEGORY(log_subdiv_trace)
Q_DECLARE_LOGGING_CATEGORY(log_mesh) Q_DECLARE_LOGGING_CATEGORY(log_mesh)
#endif #endif
...@@ -139,10 +139,10 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) { ...@@ -139,10 +139,10 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
Tables tables; Tables tables;
QVector<unsigned int> ib = input.index_buffer; QVector<unsigned int> ib = input.index_buffer;
qCDebug(log_subdiv) << "Index Buffer: " << ib; qCDebug(log_subdiv_trace) << "Index Buffer: " << ib;
QVector<Vertex> vb = input.vertex_buffer; QVector<Vertex> vb = input.vertex_buffer;
qCDebug(log_subdiv) << "Vertex Buffer: " << vb; qCDebug(log_subdiv_trace) << "Vertex Buffer: " << vb;
QVector<Triangle> triangles; QVector<Triangle> triangles;
for (int i = 0; i < ib.length(); i+=3) { for (int i = 0; i < ib.length(); i+=3) {
...@@ -256,11 +256,13 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) { ...@@ -256,11 +256,13 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
} }
qCDebug(log_subdiv) << "Done with edge table. " << tables.edge_indices.length(); qCDebug(log_subdiv) << "Done with edge table. " << tables.edge_indices.length();
if (log_subdiv_trace().isDebugEnabled()) {
qCDebug(log_subdiv) << "Eedges found. Table: " << tables.edge_indices; qCDebug(log_subdiv) << "Eedges found. Table: " << tables.edge_indices;
qCDebug(log_subdiv) << "Table (long version):"; qCDebug(log_subdiv) << "Table (long version):";
for (int i = 0; i < tables.edge_indices.length(); i++){ for (int i = 0; i < tables.edge_indices.length(); i++){
qCDebug(log_subdiv) << "blub:" << tables.edge_indices[i]; qCDebug(log_subdiv) << "blub:" << tables.edge_indices[i];
} }
}
//compute vertex table //compute vertex table
//Format: First entry: original vertex. Other entries: adjacent vertices. //Format: First entry: original vertex. Other entries: adjacent vertices.
...@@ -581,15 +583,14 @@ Subdivision::Result Subdivision::runShader(Input input, Tables &tables) { ...@@ -581,15 +583,14 @@ Subdivision::Result Subdivision::runShader(Input input, Tables &tables) {
Vertex *ptr; Vertex *ptr;
ptr = (Vertex *) f->glMapBuffer(GL_SHADER_STORAGE_BUFFER, GL_WRITE_ONLY); ptr = (Vertex *) f->glMapBuffer(GL_SHADER_STORAGE_BUFFER, GL_WRITE_ONLY);
qCDebug(log_subdiv) << "New vertices:"; qCDebug(log_subdiv_trace) << "New vertices:";
for (int i = 0; i < input.vertex_buffer.size(); i++) { for (int i = 0; i < input.vertex_buffer.size(); i++) {
qCDebug(log_subdiv) << ptr[i].pos; qCDebug(log_subdiv_trace) << ptr[i].pos;
result.vertex_buffer.push_back(ptr[i]); result.vertex_buffer.push_back(ptr[i]);
} }
qCDebug(log_subdiv) << "New edge points:"; qCDebug(log_subdiv_trace) << "New edge points:";
for (int i = 0; i < tables.edge_indices.size() / 4; i++) { for (int i = 0; i < tables.edge_indices.size() / 4; i++) {
qCDebug(log_subdiv) << ptr[edgeOffset + i].pos; qCDebug(log_subdiv_trace) << ptr[edgeOffset + i].pos;
result.vertex_buffer.push_back(ptr[edgeOffset + i]); result.vertex_buffer.push_back(ptr[edgeOffset + i]);
} }
......
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