17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-25 08:09:47 +01:00

perf(debug): memory of the process and of its parts in the debug panel: resident, peak and private memory, card memory (GL_NVX_gpu_memory_info), the copies kept by the textures, geometry banks, models, scenery shapes and lines, sleepers and sound buffers

This commit is contained in:
2026-10-23 22:02:03 +02:00
parent 1a42009dc2
commit 2dc70a50bc
14 changed files with 346 additions and 1 deletions

View File

@@ -1484,6 +1484,25 @@ texture_manager::update() {
}
}
// what the textures keep in memory, for the debug panel
texture_manager::memory_data
texture_manager::memory() const {
memory_data result;
for( auto const &texture : m_textures ) {
if( texture.first == nullptr ) { continue; }
if( false == texture.first->data.empty() ) {
++result.cpu.count;
result.cpu.bytes += memory_of( texture.first->data );
}
if( texture.first->id != opengl_texture::invalid_id ) {
++result.gpu.count;
result.gpu.bytes += static_cast<std::uint64_t>( texture.first->size ) * 1024;
}
}
return result;
}
// debug performance string
std::string
texture_manager::info() const {