Skip to content

Commit

Permalink
vertexcodec: Reduce the amount of printed traces
Browse files Browse the repository at this point in the history
bitg[0] is always 0 because we accumulate only sizes, and we store zero
data bits for bit0... we might need to print count percentages in the
future instead but this is probably ok for now.

Also reduce the space wasted by extra whitespace.
  • Loading branch information
zeux committed Oct 3, 2024
1 parent e71f4aa commit 9326e13
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/vertexcodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1218,12 +1218,11 @@ size_t meshopt_encodeVertexBuffer(unsigned char* buffer, size_t buffer_size, con

size_t total_k = vsk.header + vsk.bitg[0] + vsk.bitg[1] + vsk.bitg[2] + vsk.bitg[3];

printf("\t\thdr %5.1f%%; bitg 0 [%4.1f%%] 1 [%4.1f%%] 2 [%4.1f%%] 3 [%4.1f%%]",
double(vsk.header) / double(total_k) * 100,
double(vsk.bitg[0]) / double(total_k) * 100, double(vsk.bitg[1]) / double(total_k) * 100,
printf(" |\thdr [%5.1f%%] bitg 1-3 [%4.1f%% %4.1f%% %4.1f%%]",
double(vsk.header) / double(total_k) * 100, double(vsk.bitg[1]) / double(total_k) * 100,
double(vsk.bitg[2]) / double(total_k) * 100, double(vsk.bitg[3]) / double(total_k) * 100);

printf("\tbitc [%4.0f%% %4.0f%% %4.0f%% %4.0f%% %4.0f%% %4.0f%% %4.0f%% %4.0f%%]",
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,
Expand Down

0 comments on commit 9326e13

Please sign in to comment.