mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Count number of input and compressed frame image bytes.
This commit is contained in:
@@ -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 };
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user