17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-25 02:14:49 +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

@@ -299,6 +299,21 @@ buffer_manager::buffer( audio::buffer_handle const Buffer ) const {
}
// creates AL buffers for files decoded in the background so far, or for all of them if requested
// the AL buffers made and the bytes of their sound data, for the debug panel
memory_count
buffer_manager::memory() const {
memory_count result;
for( auto const &buffer : m_buffers ) {
if( buffer.id == null_resource ) { continue; }
ALint size { 0 };
::alGetBufferi( buffer.id, AL_SIZE, &size );
++result.count;
result.bytes += static_cast<std::uint64_t>( std::max( size, 0 ) );
}
return result;
}
void
buffer_manager::update( bool const Wait ) {