From db9557fc844e4a9be3947b6a3d1c8eb0e42ec38b Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 14 Apr 2020 20:07:30 +0200 Subject: [PATCH] Use separate texture compression context for saving traces. --- server/TracyWorker.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index d37ae781..be530b5e 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -7001,15 +7001,18 @@ void Worker::Write( FileWrite& f ) f.Write( &sz, sizeof( sz ) ); if( sz != 0 ) f.Write( m_data.appInfo.data(), sizeof( m_data.appInfo[0] ) * sz ); - sz = m_data.frameImage.size(); - f.Write( &sz, sizeof( sz ) ); - for( auto& fi : m_data.frameImage ) { - f.Write( &fi->w, sizeof( fi->w ) ); - f.Write( &fi->h, sizeof( fi->h ) ); - f.Write( &fi->flip, sizeof( fi->flip ) ); - const auto image = m_texcomp.Unpack( *fi ); - f.Write( image, fi->w * fi->h / 2 ); + TextureCompression texcomp; + sz = m_data.frameImage.size(); + f.Write( &sz, sizeof( sz ) ); + for( auto& fi : m_data.frameImage ) + { + f.Write( &fi->w, sizeof( fi->w ) ); + f.Write( &fi->h, sizeof( fi->h ) ); + f.Write( &fi->flip, sizeof( fi->flip ) ); + const auto image = texcomp.Unpack( *fi ); + f.Write( image, fi->w * fi->h / 2 ); + } } // Only save context switches relevant to active threads.