mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-31 00:46:36 +00:00
bonsaiviewer: show pool and device VRAM in the performance stats
FrameStats gains the geometry pool's used/capacity bytes and, on desktop, the device-wide used/total reported by the driver (NVML via dlopen, or amdgpu/i915 sysfs, matched to the wgpu adapter's vendor/device id so a switchable-graphics laptop reports the card wgpu actually picked). The device query is polled once a second, not per frame. Web has no VRAM query, so the device figure is omitted there. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,16 @@ struct FrameStats {
|
||||
std::uint32_t unique_meshes;
|
||||
std::uint32_t gl_draw_calls; // wgpu draw-call count; name kept for bonsai parity
|
||||
std::uint32_t indirect_sub_draws; // sub-draws packed into the chunk-indirect lists
|
||||
// Chunk geometry pool occupancy (see BufferPool). wgpu exposes no
|
||||
// adapter-wide VRAM query, so this is the viewer's own allocation,
|
||||
// not the device total.
|
||||
std::uint64_t vram_used_bytes;
|
||||
std::uint64_t vram_capacity_bytes;
|
||||
// Whole-device VRAM from the driver (NVML / sysfs, see GpuMemory.h).
|
||||
// Desktop only; zero on web or when no backend could answer, so
|
||||
// consumers must treat 0 as "unknown" rather than as empty.
|
||||
std::uint64_t device_vram_used_bytes;
|
||||
std::uint64_t device_vram_total_bytes;
|
||||
};
|
||||
|
||||
#endif // IFCVIEWER_FRAMESTATS_H
|
||||
|
||||
Reference in New Issue
Block a user