From f1924bd2219a4b39299ed61a3d694ced5b88c1d9 Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Sat, 28 Sep 2013 21:43:25 -0400 Subject: [PATCH] Try to send a single string that encompasses a stat to the stream so that when we do synchronization it will crunch the entire string at once. --- BPTCEncoder/src/BC7Compressor.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/BPTCEncoder/src/BC7Compressor.cpp b/BPTCEncoder/src/BC7Compressor.cpp index a5f0e86..8a2a4f0 100755 --- a/BPTCEncoder/src/BC7Compressor.cpp +++ b/BPTCEncoder/src/BC7Compressor.cpp @@ -98,6 +98,8 @@ #include #include #include +#include +#include // #define USE_PCA_FOR_SHAPE_ESTIMATION @@ -1555,7 +1557,9 @@ namespace BC7C { template std::ostream &operator<<(const BlockLogger &bl, const T &v) { - return bl.m_Stream << bl.m_BlockIdx << ": " << v; + std::stringstream ss; + ss << bl.m_BlockIdx << ": " << v; + return bl.m_Stream << ss.str(); } // Function prototypes @@ -2223,7 +2227,9 @@ namespace BC7C { template static void PrintStat(const BlockLogger &lgr, const char *stat, const T &v) { - lgr << stat << " -- " << v << std::endl; + std::stringstream ss; + ss << stat << " -- " << v << std::endl; + lgr << ss.str(); } // Compress a single block but collect statistics as well...