From 218f4570a97ad4bd476b3d2606ab37bc143c444d Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Wed, 18 Dec 2024 08:39:21 -0800 Subject: [PATCH] vertexcodec: Only output bit consistency data in verbose traces 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). --- Makefile | 4 ++++ src/vertexcodec.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 5429747006..3e9d846dbf 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/src/vertexcodec.cpp b/src/vertexcodec.cpp index 0adf0d4921..a1738b91b9 100644 --- a/src/vertexcodec.cpp +++ b/src/vertexcodec.cpp @@ -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"); }