X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fmixer%2Fgpu%2Fhost_buffer.cpp;h=aefcb9e5b5f6e8b8e80e900c06dcc42d059ba413;hb=af660bb0772edbc122286d1e1bc1ded9bc6b2794;hp=e1695f07fa8dcbc651c118a607857512a5811f5c;hpb=40c4bd4d2cd9c055717d1bbaf664c428c9ddea7a;p=casparcg diff --git a/core/mixer/gpu/host_buffer.cpp b/core/mixer/gpu/host_buffer.cpp index e1695f07f..aefcb9e5b 100644 --- a/core/mixer/gpu/host_buffer.cpp +++ b/core/mixer/gpu/host_buffer.cpp @@ -30,7 +30,12 @@ #include +#include + namespace caspar { namespace core { + +static tbb::atomic g_w_total_count; +static tbb::atomic g_r_total_count; struct host_buffer::implementation : boost::noncopyable { @@ -58,7 +63,7 @@ public: if(!pbo_) BOOST_THROW_EXCEPTION(caspar_exception() << msg_info("Failed to allocate buffer.")); - CASPAR_LOG(debug) << "[host_buffer] allocated size:" << size_ << " usage: " << (usage == write_only ? "write_only" : "read_only"); + CASPAR_LOG(debug) << "[host_buffer] [" << ++(usage_ == write_only ? g_w_total_count : g_r_total_count) << L"] allocated size:" << size_ << " usage: " << (usage == write_only ? "write_only" : "read_only"); } ~implementation() @@ -66,6 +71,7 @@ public: try { GL(glDeleteBuffers(1, &pbo_)); + CASPAR_LOG(debug) << "[host_buffer] [" << --(usage_ == write_only ? g_w_total_count : g_r_total_count) << L"] deallocated size:" << size_ << " usage: " << (usage_ == write_only ? "write_only" : "read_only"); } catch(...) {