Skip to content

Commit

Permalink
vertexcodec: Only output bit consistency data in verbose traces
Browse files Browse the repository at this point in the history
These clutter the view and are not as useful as the other data, as it
doesn't depend on encoding choices we're making. To make verbose traces
easier to access, add tracev config (which is useful for simplifier as
well).
  • Loading branch information
zeux committed Dec 18, 2024
1 parent eca13a3 commit 218f457
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ ifeq ($(config),trace)
CXXFLAGS+=-DTRACE=1
endif

ifeq ($(config),tracev)
CXXFLAGS+=-DTRACE=2
endif

ifeq ($(config),release)
CXXFLAGS+=-O3 -DNDEBUG
endif
Expand Down
2 changes: 2 additions & 0 deletions src/vertexcodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1690,11 +1690,13 @@ size_t meshopt_encodeVertexBuffer(unsigned char* buffer, size_t buffer_size, con
double(vsk.ctrl[2]) / double(total_ctrl) * 100, double(vsk.ctrl[3]) / double(total_ctrl) * 100);
}

#if TRACE > 1
printf(" |\tbitc [%3.0f%% %3.0f%% %3.0f%% %3.0f%% %3.0f%% %3.0f%% %3.0f%% %3.0f%%]",
double(vsk.bitc[0]) / double(vertex_count) * 100, double(vsk.bitc[1]) / double(vertex_count) * 100,
double(vsk.bitc[2]) / double(vertex_count) * 100, double(vsk.bitc[3]) / double(vertex_count) * 100,
double(vsk.bitc[4]) / double(vertex_count) * 100, double(vsk.bitc[5]) / double(vertex_count) * 100,
double(vsk.bitc[6]) / double(vertex_count) * 100, double(vsk.bitc[7]) / double(vertex_count) * 100);
#endif

printf("\n");
}
Expand Down

0 comments on commit 218f457

Please sign in to comment.