Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf.pld@gmail.com>2020-03-14 16:35:57 +0300
committerBartosz Taudul <wolf.pld@gmail.com>2020-03-14 16:35:57 +0300
commitb8cc3f59d64dbcfa2fdd018e81caa411a70623c3 (patch)
tree7b937d03d2732a340f83399da396b1d1ecc8cda8 /server/TracyTextureCompression.hpp
parent0776dddc35c7199764e96762ab10d9e4e4c4f6e5 (diff)
Count number of input and compressed frame image bytes.
Diffstat (limited to 'server/TracyTextureCompression.hpp')
-rw-r--r--server/TracyTextureCompression.hpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/server/TracyTextureCompression.hpp b/server/TracyTextureCompression.hpp
index 5c5d8ebe..89b161bf 100644
--- a/server/TracyTextureCompression.hpp
+++ b/server/TracyTextureCompression.hpp
@@ -1,6 +1,8 @@
#ifndef __TRACY__TEXTURECOMPRESSION_HPP__
#define __TRACY__TEXTURECOMPRESSION_HPP__
+#include <atomic>
+
#include <stdint.h>
#include <stdlib.h>
@@ -20,7 +22,7 @@ public:
TextureCompression();
~TextureCompression();
- uint32_t Pack( struct ZSTD_CCtx_s* ctx, char*& buf, size_t& bufsz, const char* image, uint32_t inBytes ) const;
+ uint32_t Pack( struct ZSTD_CCtx_s* ctx, char*& buf, size_t& bufsz, const char* image, uint32_t inBytes );
template<size_t Size>
const char* Pack( const char* image, uint32_t inBytes, uint32_t& csz, Slab<Size>& slab )
@@ -34,11 +36,17 @@ public:
const char* Unpack( const FrameImage& image );
+ uint64_t GetInputBytesCount() const { return m_inputBytes.load( std::memory_order_relaxed ); }
+ uint64_t GetOutputBytesCount() const { return m_outputBytes.load( std::memory_order_relaxed ); }
+
private:
char* m_buf;
size_t m_bufSize;
struct ZSTD_CCtx_s* m_cctx;
struct ZSTD_DCtx_s* m_dctx;
+
+ std::atomic<uint64_t> m_inputBytes { 0 };
+ std::atomic<uint64_t> m_outputBytes { 0 };
};
}