mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 16:19:19 +02:00
Add headless parallel eu7v2 scenario bake with streaming and PLCE placements
Enable --eu7v2-bake from the main binary: parallel module pool, bounded-RAM spool flush, streaming terrain triangles, flat include/model parsing, and eu7v2 emit/load with optional verify. Large placement .scm files emit lean PLCE records and bake referenced .inc modules separately for reuse. - CLI: --eu7v2-bake, --eu7v2-verify, --eu7v2-mem-limit-gb, --eu7v2-threads, --eu7v2-max-parse; wire max_threads through to the bake parser - eu7v2 v2 records: PLCE placements, runtime emitter/loader, batch verify - Parallel bake pool with session cache; drop heavy-serial parse gate in spool mode; parse concurrency matches thread count - Streaming terrain: batched parallel parse+bake, scan/bake pipeline, shape spool with persistent buffered I/O and flush-before-read - Parallel flat-file streaming for models/includes; pack/model spool for low-memory incremental flush - Optional 50 GB private-bytes guard during headless bake Braniewo_szeroki: 160 modules, verify PASS, ~34s bake (nmt100 ~17s vs ~190s serial baseline). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
36
scene/eu7/v2/eu7v2_load.h
Normal file
36
scene/eu7/v2/eu7v2_load.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
This Source Code Form is subject to the
|
||||
terms of the Mozilla Public License, v.
|
||||
2.0. If a copy of the MPL was not
|
||||
distributed with this file, You can
|
||||
obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
namespace scene::eu7 {
|
||||
struct Eu7Scene;
|
||||
struct Eu7Module;
|
||||
} // namespace scene::eu7
|
||||
|
||||
namespace eu7v2 {
|
||||
|
||||
// Reconstructs a parsed scene from an eu7v2 container produced by bake_scene()
|
||||
// / bake_module(). The reconstructed Eu7Scene can be fed to the existing apply
|
||||
// path, so switching to the new format only swaps serialization and reuses the
|
||||
// proven world-construction code. Returns false on a malformed container (the
|
||||
// scene is left in a partially-populated but safe state).
|
||||
[[nodiscard]] bool
|
||||
load_scene( std::uint8_t const *data, std::size_t size, scene::eu7::Eu7Scene &out );
|
||||
|
||||
// Reconstructs a full module (scene + includes + placement + flags) from an
|
||||
// eu7v2 container. The runtime needs the includes to recurse into child
|
||||
// modules. Returns false on a malformed container.
|
||||
[[nodiscard]] bool
|
||||
load_module( std::uint8_t const *data, std::size_t size, scene::eu7::Eu7Module &out );
|
||||
|
||||
} // namespace eu7v2
|
||||
Reference in New Issue
Block a user