mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 16:31:10 +00:00
ifcviewer: move scene state into ViewportCore (#84-c)
Move the five scene-state fields that drive per-model GPU upload + the
streaming residency loop into ViewportCore:
BufferPool pool_ — vertex+index sub-allocator
StreamingThread streaming_thread_ — background chunk reader
std::unordered_map<uint32_t, ModelGpuData> models_gpu_
— per-model state
uint32_t next_model_id_ — model-id allocator
uint32_t next_object_id_ — globally-unique object-id allocator
ViewportCore.h gains transitive includes for BufferPool / StreamingThread
/ ModelGpuData; ViewportWindow keeps the same names as reference aliases
so existing method bodies that touch them don't have to change.
Same risk profile as #84-a and #84-b: the storage moved but the values
are still set and consumed by the same code paths, so behaviour stays
identical.
Builds: desktop / bonsai / web all green. Tests 100/100.
This commit is contained in:
@@ -984,14 +984,9 @@ public:
|
||||
// ceiling that one-WGPUBuffer-per-chunk would otherwise hit. All
|
||||
// chunk allocations land here; nothing else uses the pool. Replaces
|
||||
// the old hand-picked streaming_vram_budget_bytes_ knob entirely.
|
||||
BufferPool pool_;
|
||||
|
||||
// Background worker that does scatter-gather chunk reads off the
|
||||
// render thread. driveStreamingLoads enqueues requests for visible
|
||||
// non-resident chunks and drains completed results into the pool
|
||||
// on subsequent frames. Kills the 100-300 ms per-frame stutters
|
||||
// that synchronous disk reads caused during orbit.
|
||||
StreamingThread streaming_thread_;
|
||||
// Scene-state aliases (storage in core_).
|
||||
BufferPool& pool_;
|
||||
StreamingThread& streaming_thread_;
|
||||
|
||||
// Per-frame streaming activity, written by driveStreamingLoads,
|
||||
// consumed by the benchmark harness to delay the orbit sweep until
|
||||
@@ -1025,13 +1020,10 @@ private:
|
||||
// mirror AppSettings::lod1PixelThreshold() in the GL backend.
|
||||
float lod1_pixel_threshold_ = 30.0f;
|
||||
|
||||
// Per-model state, keyed by viewport-assigned model_id.
|
||||
std::unordered_map<uint32_t, ModelGpuData> models_gpu_;
|
||||
uint32_t next_model_id_ = 1;
|
||||
// Globally-unique object_id allocator. Each applyCachedModel rebases
|
||||
// the sidecar's local object_ids by base_object_id_so_far so picks
|
||||
// are unambiguous across models. Selection flags index this range.
|
||||
uint32_t next_object_id_ = 1;
|
||||
// Per-model state aliases (storage in core_).
|
||||
std::unordered_map<uint32_t, ModelGpuData>& models_gpu_;
|
||||
uint32_t& next_model_id_;
|
||||
uint32_t& next_object_id_;
|
||||
|
||||
// Sidecar paths queued before init completes.
|
||||
std::deque<std::string> pending_sidecars_;
|
||||
|
||||
Reference in New Issue
Block a user