BVH frustum culling, sidecar cache, per-model buffers, progressive upload

Phase 2 performance: BVH acceleration with median-split build, per-model
trees, and EBO re-sorting for GPU cache coherence. Raw binary .ifcview
sidecar stores full geometry + BVH for instant subsequent loads (skip
tessellation entirely).

Per-model GPU buffers (VAO/VBO/EBO per model) eliminate cross-model buffer
copies on growth. Sidecar reads happen on a background thread. Bulk GPU
uploads are progressive (48 MB/frame chunks) so the viewport stays
interactive while multi-GB models stream in.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dion Moult
2026-04-12 09:09:32 +10:00
parent 5b4c1089cf
commit 1dace18d26
9 changed files with 1541 additions and 327 deletions
+7
View File
@@ -31,6 +31,7 @@
#include <map>
#include <deque>
#include <thread>
#include <unordered_map>
#include "ViewportWindow.h"
@@ -72,6 +73,11 @@ private:
void setupMenus();
void populateProperties(uint32_t object_id);
void startNextLoad();
void applySidecarData(ModelId mid, SidecarData data);
void joinSidecarThread();
void populateTreeFromSidecar(ModelHandle& model,
const std::vector<PackedElementInfo>& elements,
const std::string& string_table);
void connectStreamer(GeometryStreamer* streamer);
ViewportWindow* viewport_ = nullptr;
@@ -91,6 +97,7 @@ private:
uint32_t next_object_id_ = 1; // monotonically increasing across all models
std::deque<ModelId> load_queue_;
ModelId loading_model_id_ = 0;
std::thread sidecar_read_thread_;
// Map object_id -> tree item and element info
std::unordered_map<uint32_t, ElementInfo> element_map_;