src/config/generate.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // SPDX-License-Identifier: BSD-3-Clause | ||
| 2 | |||
| 3 | #include "terraingen/config/generate.h" | ||
| 4 | |||
| 5 | #include "config/terrain.h" | ||
| 6 | #include "terraingen/config/build.h" | ||
| 7 | #include "terraingen/config/json.h" | ||
| 8 | #include "terraingen/gpu/backend.h" | ||
| 9 | #include "terraingen/mesh/io/icq.h" | ||
| 10 | #include "terraingen/mesh/mesh_build.h" | ||
| 11 | #include "terraingen/pipeline/body_mesh.h" | ||
| 12 | #include "terraingen/util/log.h" | ||
| 13 | |||
| 14 | #include <algorithm> | ||
| 15 | #include <cmath> | ||
| 16 | #include <cstdint> | ||
| 17 | #include <iomanip> | ||
| 18 | #include <memory> | ||
| 19 | #include <optional> | ||
| 20 | #include <sstream> | ||
| 21 | #include <stdexcept> | ||
| 22 | #include <string> | ||
| 23 | #include <type_traits> | ||
| 24 | #include <utility> | ||
| 25 | #include <variant> | ||
| 26 | #include <vector> | ||
| 27 | |||
| 28 | namespace terraingen { | ||
| 29 | |||
| 30 | namespace { | ||
| 31 | |||
| 32 | /// Whether an output needs the heights over its grid: a raster or a terrain mesh. | ||
| 33 | 179 | bool NeedsHeights(const OutputSpec& output) { | |
| 34 | 179 | return config::HoldsAny<HeightmapOutput, AlbedoOutput, TerrainMeshOutput, MaterialsOutput, | |
| 35 | 179 | PhotometryOutput>(output); | |
| 36 | } | ||
| 37 | |||
| 38 | /// One step of generating a terrain and the time it took over every grid. | ||
| 39 | 671 | struct StepTime { | |
| 40 | std::string name; | ||
| 41 | double milliseconds = 0.0; | ||
| 42 | }; | ||
| 43 | |||
| 44 | /// The steps after the layers, in order. | ||
| 45 | enum class Step { Albedo, Materials, Features, Meshes }; | ||
| 46 | |||
| 47 | /// A sample spacing in meters to three significant figures, or in kilometers from 1 km. | ||
| 48 | 104 | std::string FormatSpacing(double meters) { | |
| 49 | 104 | std::ostringstream text; | |
| 50 | 104 | text << std::setprecision(3); | |
| 51 | 104 | if (meters >= 1000.0) { | |
| 52 | ✗ | text << meters / 1000.0 << " km"; | |
| 53 | } else { | ||
| 54 | 104 | text << meters << " m"; | |
| 55 | } | ||
| 56 | 208 | return text.str(); | |
| 57 | 104 | } | |
| 58 | |||
| 59 | /// Logs the time of each step that ran and its share of `total` milliseconds. | ||
| 60 | 110 | void LogStepTimes(const std::vector<StepTime>& steps, std::size_t grids, double total) { | |
| 61 | 110 | std::size_t width = 0; | |
| 62 | 775 | for (const StepTime& step : steps) { | |
| 63 | 918 | width = std::max(width, step.name.size()); | |
| 64 | } | ||
| 65 | 119 | LogInfo("pipeline", "Time per step over ", grids, grids == 1 ? " grid" : " grids", ", of ", | |
| 66 | 110 | FormatDuration(total), ":"); | |
| 67 | 775 | for (const StepTime& step : steps) { | |
| 68 | 665 | if (step.milliseconds <= 0.0) { | |
| 69 | 396 | continue; | |
| 70 | } | ||
| 71 | 269 | std::ostringstream line; | |
| 72 | 269 | line << " " << std::left << std::setw(static_cast<int>(width)) << step.name << std::right | |
| 73 | 538 | << std::setw(10) << FormatDuration(step.milliseconds) << std::setw(5) | |
| 74 | 269 | << std::llround(100.0 * step.milliseconds / std::fmax(total, 1e-9)) << "%"; | |
| 75 | 269 | LogInfo("pipeline", line.str()); | |
| 76 | 269 | } | |
| 77 | 110 | } | |
| 78 | |||
| 79 | /// The distinct grids of `grids`, in order. | ||
| 80 | 111 | std::vector<RasterGrid> DistinctGrids(const std::vector<std::optional<RasterGrid>>& grids) { | |
| 81 | 111 | std::vector<RasterGrid> distinct; | |
| 82 | 304 | for (const std::optional<RasterGrid>& grid : grids) { | |
| 83 | 193 | if (grid && std::find(distinct.begin(), distinct.end(), *grid) == distinct.end()) { | |
| 84 | 116 | distinct.push_back(*grid); | |
| 85 | } | ||
| 86 | } | ||
| 87 | 111 | return distinct; | |
| 88 | } | ||
| 89 | |||
| 90 | /// Generates what each output asks for over its grid (`GeneratedOutputs::outputGrids`), once per | ||
| 91 | /// grid and result, timing each step. | ||
| 92 | class OutputGenerator { | ||
| 93 | public: | ||
| 94 | /// @param outputs What each output covers (`config::CheckedTerrain::outputs`). | ||
| 95 | 111 | OutputGenerator(const ConfigSpec& config, GeneratedOutputs& generated, | |
| 96 | const std::filesystem::path& directory, unsigned threads, | ||
| 97 | std::vector<config::OutputGrid> outputs) | ||
| 98 | 111 | : m_config(config), m_generated(generated), m_directory(directory), m_threads(threads), | |
| 99 | 111 | m_outputs(std::move(outputs)), m_grids(DistinctGrids(generated.outputGrids)) { | |
| 100 | 338 | for (std::size_t n = 0; n < config.layers.size(); ++n) { | |
| 101 | 227 | m_steps.push_back( | |
| 102 | 454 | {"layer " + std::to_string(n + 1) + " " + LayerType(config.layers[n])}); | |
| 103 | } | ||
| 104 | 555 | for (const char* name : {"albedo", "materials", "features", "meshes"}) { | |
| 105 | 444 | m_steps.push_back({name}); | |
| 106 | } | ||
| 107 | 1453 | } | |
| 108 | |||
| 109 | /// Generates what output `i` asks for, unless an earlier output did. | ||
| 110 | 193 | void Generate(std::size_t i) { | |
| 111 | 193 | const OutputSpec& output = m_config.outputs[i]; | |
| 112 | 193 | if (const auto* mesh = std::get_if<MeshOutput>(&output)) { | |
| 113 | 7 | AddBodyMesh(*mesh); | |
| 114 | 7 | return; | |
| 115 | } | ||
| 116 | 186 | const std::optional<RasterGrid>& grid = m_generated.outputGrids[i]; | |
| 117 | 186 | if (!grid) { | |
| 118 | return; | ||
| 119 | } | ||
| 120 | 179 | GeneratedGrid& target = Target(*grid); | |
| 121 | 179 | if (NeedsHeights(output) && target.heights.Empty()) { | |
| 122 | 104 | AddHeights(target); | |
| 123 | } | ||
| 124 | 179 | if (std::holds_alternative<AlbedoOutput>(output) && target.albedo.empty()) { | |
| 125 | 9 | AddAlbedo(target); | |
| 126 | } | ||
| 127 | 179 | AddMaterials(output, target); | |
| 128 | 179 | AddFeatures(output, m_outputs[i].featureSpacing, target); | |
| 129 | 186 | if (const auto* mesh = std::get_if<TerrainMeshOutput>(&output); mesh && !target.mesh) { | |
| 130 | 7 | AddTerrainMesh(*mesh, target); | |
| 131 | } | ||
| 132 | } | ||
| 133 | |||
| 134 | /// Logs the time of each step, of `total` milliseconds, when anything was generated. | ||
| 135 | 111 | void LogTimes(double total) const { | |
| 136 | 111 | if (!m_generated.grids.empty() || m_generated.bodyMesh || m_generated.bodyIcq) { | |
| 137 | 110 | LogStepTimes(m_steps, m_generated.grids.size(), total); | |
| 138 | } | ||
| 139 | 111 | } | |
| 140 | |||
| 141 | /// Each layer's type and its time summed over every evaluation, in order. | ||
| 142 | 7 | std::vector<LayerTiming> LayerTimings() const { | |
| 143 | 7 | std::vector<LayerTiming> timings; | |
| 144 | 25 | for (std::size_t n = 0; n < m_config.layers.size(); ++n) { | |
| 145 | 18 | timings.push_back({LayerType(m_config.layers[n]), m_steps[n].milliseconds / 1000.0}); | |
| 146 | } | ||
| 147 | 7 | return timings; | |
| 148 | 18 | } | |
| 149 | |||
| 150 | private: | ||
| 151 | 285 | void Timed(std::size_t step, double milliseconds) { | |
| 152 | 285 | m_steps[step].milliseconds += milliseconds; | |
| 153 | 285 | LogInfo("pipeline", " ", m_steps[step].name, " in ", FormatDuration(milliseconds)); | |
| 154 | 285 | } | |
| 155 | |||
| 156 | 77 | void Timed(Step step, double milliseconds) { | |
| 157 | 77 | Timed(m_config.layers.size() + static_cast<std::size_t>(step), milliseconds); | |
| 158 | 77 | } | |
| 159 | |||
| 160 | /// The generated grid over `grid`, added empty the first time. | ||
| 161 | 179 | GeneratedGrid& Target(const RasterGrid& grid) { | |
| 162 | 179 | if (GeneratedGrid* existing = m_generated.Find(grid)) { | |
| 163 | return *existing; | ||
| 164 | } | ||
| 165 | 116 | GeneratedGrid added; | |
| 166 | 116 | added.grid = grid; | |
| 167 | 116 | m_generated.grids.push_back(std::move(added)); | |
| 168 | 116 | return m_generated.grids.back(); | |
| 169 | 116 | } | |
| 170 | |||
| 171 | /// How grids are evaluated: on the configured threads and backend. | ||
| 172 | 105 | EvaluationOptions Options() const { | |
| 173 | 105 | return EvaluationOptions{}.Threads(m_threads).On(m_generated.backend); | |
| 174 | } | ||
| 175 | |||
| 176 | 104 | void AddHeights(GeneratedGrid& target) { | |
| 177 | 104 | const Terrain& terrain = m_generated.terrain; | |
| 178 | 104 | const auto index = static_cast<std::size_t>( | |
| 179 | 104 | std::find(m_grids.begin(), m_grids.end(), target.grid) - m_grids.begin()); | |
| 180 | 104 | LogInfo("pipeline", "Grid ", index + 1, " of ", m_grids.size(), ": ", target.grid.width, | |
| 181 | 104 | "x", target.grid.height, " at ", | |
| 182 | 104 | FormatSpacing(target.grid.Spacing(terrain.Surface()))); | |
| 183 | 104 | EvaluationOptions options = Options(); | |
| 184 | 416 | options.onLayer = [this](std::size_t step, double milliseconds) { | |
| 185 | 208 | Timed(step, milliseconds); | |
| 186 | 104 | }; | |
| 187 | 104 | target.heights = terrain.Evaluate(target.grid, options); | |
| 188 | 104 | } | |
| 189 | |||
| 190 | 9 | void AddAlbedo(GeneratedGrid& target) { | |
| 191 | 9 | const Stopwatch stopwatch; | |
| 192 | 9 | const Terrain& terrain = m_generated.terrain; | |
| 193 | 9 | if (!m_albedo) { | |
| 194 | 9 | m_albedo = | |
| 195 | 9 | config::BuildValidAlbedo(*m_config.albedo, m_config.layers, terrain, m_directory); | |
| 196 | } | ||
| 197 | 9 | target.albedo = EvaluateAlbedo(*m_albedo, target.grid, terrain.Context(0.0, m_threads)); | |
| 198 | 9 | Timed(Step::Albedo, stopwatch.Milliseconds()); | |
| 199 | 9 | } | |
| 200 | |||
| 201 | /// Adds the material map a materials or photometry output asks for, and the photometry. | ||
| 202 | 179 | void AddMaterials(const OutputSpec& output, GeneratedGrid& target) { | |
| 203 | 179 | if (config::HoldsAny<MaterialsOutput, PhotometryOutput>(output) && | |
| 204 | 2 | target.materials.empty()) { | |
| 205 | 1 | const Stopwatch stopwatch; | |
| 206 | 1 | target.materials = EvaluateMaterials(m_generated.terrain, m_config.materials->options, | |
| 207 | 1 | target.grid, Options()); | |
| 208 | 1 | Timed(Step::Materials, stopwatch.Milliseconds()); | |
| 209 | } | ||
| 210 | 179 | if (std::holds_alternative<PhotometryOutput>(output) && target.photometry.empty()) { | |
| 211 | 1 | const Stopwatch stopwatch; | |
| 212 | 4 | target.photometry = EvaluatePhotometry( | |
| 213 | 1 | target.materials, config::BuildPhotometry(m_config.materials->photometry)); | |
| 214 | 1 | Timed(Step::Materials, stopwatch.Milliseconds()); | |
| 215 | } | ||
| 216 | 179 | } | |
| 217 | |||
| 218 | /// Places the craters a crater list asks for, or the boulders a boulder list or models do, at | ||
| 219 | /// `spacing` meters (0 for the grid's own). | ||
| 220 | 179 | void AddFeatures(const OutputSpec& output, double spacing, GeneratedGrid& target) { | |
| 221 | 179 | const Terrain& terrain = m_generated.terrain; | |
| 222 | 179 | if (std::holds_alternative<CraterListOutput>(output) && !target.craters) { | |
| 223 | 42 | const Stopwatch stopwatch; | |
| 224 | 42 | target.craters = terrain.Craters(target.grid, spacing); | |
| 225 | 42 | Timed(Step::Features, stopwatch.Milliseconds()); | |
| 226 | } | ||
| 227 | 179 | if (config::HoldsAny<BoulderListOutput, BoulderModelsOutput>(output) && !target.boulders) { | |
| 228 | 11 | const Stopwatch stopwatch; | |
| 229 | 11 | target.boulders = terrain.Boulders(target.grid, spacing); | |
| 230 | 11 | Timed(Step::Features, stopwatch.Milliseconds()); | |
| 231 | } | ||
| 232 | 179 | } | |
| 233 | |||
| 234 | 7 | void AddTerrainMesh(const TerrainMeshOutput& output, GeneratedGrid& target) { | |
| 235 | 7 | const Stopwatch stopwatch; | |
| 236 | 7 | BuildMeshOptions options; | |
| 237 | 7 | options.skirt = output.skirt; | |
| 238 | 7 | for (const ExtentSpec& cutout : output.cutouts) { | |
| 239 | ✗ | options.cutouts.push_back(config::ExtentBox(cutout)); | |
| 240 | } | ||
| 241 | 7 | const Vec2d site = output.siteDeg ? Vec2d{(*output.siteDeg)[0], (*output.siteDeg)[1]} | |
| 242 | 7 | : target.grid.Bounds().Center(); | |
| 243 | 7 | target.mesh = BuildMesh(target.heights, m_generated.terrain.Surface(), site, options); | |
| 244 | 7 | Timed(Step::Meshes, stopwatch.Milliseconds()); | |
| 245 | 7 | } | |
| 246 | |||
| 247 | 7 | void AddBodyMesh(const MeshOutput& output) { | |
| 248 | 7 | const Stopwatch stopwatch; | |
| 249 | 7 | const Terrain& terrain = m_generated.terrain; | |
| 250 | 7 | const double spacing = output.spacing.value_or(0.0); | |
| 251 | 14 | if (IsIcqPath(output.path)) { | |
| 252 | 3 | if (!m_generated.bodyIcq) { | |
| 253 | 3 | m_generated.bodyIcq = BodyIcq(terrain, output.cellsPerFace, spacing, m_threads); | |
| 254 | 3 | Timed(Step::Meshes, stopwatch.Milliseconds()); | |
| 255 | } | ||
| 256 | 4 | } else if (!m_generated.bodyMesh) { | |
| 257 | 3 | m_generated.bodyMesh = BodyMesh(terrain, output.cellsPerFace, spacing, m_threads); | |
| 258 | 3 | Timed(Step::Meshes, stopwatch.Milliseconds()); | |
| 259 | } | ||
| 260 | 7 | } | |
| 261 | |||
| 262 | const ConfigSpec& m_config; | ||
| 263 | GeneratedOutputs& m_generated; | ||
| 264 | const std::filesystem::path& m_directory; | ||
| 265 | unsigned m_threads; | ||
| 266 | std::vector<config::OutputGrid> m_outputs; | ||
| 267 | std::vector<RasterGrid> m_grids; | ||
| 268 | std::vector<StepTime> m_steps; | ||
| 269 | std::optional<Albedo> m_albedo; | ||
| 270 | }; | ||
| 271 | |||
| 272 | /// A field-list `IO` that finds a layer's top-level "seed", or its inner layer's in a masked | ||
| 273 | /// layer. | ||
| 274 | class SeedFinder { | ||
| 275 | public: | ||
| 276 | template <typename T> | ||
| 277 | 15 | void operator()(std::string_view key, T& value, std::string_view /*description*/ = {}, | |
| 278 | std::string_view /*unit*/ = {}, const FieldRange& /*range*/ = {}) { | ||
| 279 | if constexpr (std::is_same_v<T, std::uint32_t>) { | ||
| 280 | 14 | if (key == "seed") { | |
| 281 | 11 | seed = value; | |
| 282 | } | ||
| 283 | } else if constexpr (std::is_same_v<T, Boxed<LayerSpec>>) { | ||
| 284 | 1 | Find(*value); | |
| 285 | } | ||
| 286 | 1 | } | |
| 287 | |||
| 288 | /// Visits the fields of `layer`. | ||
| 289 | 19 | void Find(LayerSpec layer) { | |
| 290 | 20 | std::visit([this](auto& spec) { Fields(*this, spec); }, layer); | |
| 291 | } | ||
| 292 | |||
| 293 | std::optional<std::uint32_t> seed; | ||
| 294 | }; | ||
| 295 | |||
| 296 | /// The top-level "seed" of each layer that has one, in order, a masked layer's from inside. | ||
| 297 | 7 | std::vector<std::uint32_t> LayerSeeds(const ConfigSpec& config) { | |
| 298 | 7 | std::vector<std::uint32_t> seeds; | |
| 299 | 25 | for (const LayerSpec& layer : config.layers) { | |
| 300 | 18 | SeedFinder finder; | |
| 301 | 36 | finder.Find(layer); | |
| 302 | 18 | if (finder.seed) { | |
| 303 | 11 | seeds.push_back(*finder.seed); | |
| 304 | } | ||
| 305 | } | ||
| 306 | 7 | return seeds; | |
| 307 | } | ||
| 308 | |||
| 309 | /// The density of the terrain's first top-level crater layer, or null without one. | ||
| 310 | 7 | std::shared_ptr<const SizeFrequencyDistribution> CraterTarget(const Terrain& terrain) { | |
| 311 | 14 | for (const LayerPtr& layer : terrain.Layers()) { | |
| 312 | 14 | if (const auto* craters = dynamic_cast<const CraterLayer*>(layer.get())) { | |
| 313 | 7 | return craters->Models().density; | |
| 314 | } | ||
| 315 | } | ||
| 316 | ✗ | return nullptr; | |
| 317 | } | ||
| 318 | |||
| 319 | /// The report of what was generated from `config`, with each layer's summed `timings`. | ||
| 320 | 7 | TerrainReport BuildReport(const ConfigSpec& config, const GeneratedOutputs& generated, | |
| 321 | std::vector<LayerTiming> timings, unsigned threads) { | ||
| 322 | 7 | TerrainReport report; | |
| 323 | 7 | const std::shared_ptr<const SizeFrequencyDistribution> target = CraterTarget(generated.terrain); | |
| 324 | 16 | for (const GeneratedGrid& grid : generated.grids) { | |
| 325 | 9 | if (grid.heights.Empty()) { | |
| 326 | 1 | continue; | |
| 327 | } | ||
| 328 | 25 | report.grids.push_back(ReportGrid( | |
| 329 | 8 | grid.heights, generated.terrain.Surface(), grid.craters ? &*grid.craters : nullptr, | |
| 330 | 8 | grid.boulders ? &*grid.boulders : nullptr, target.get(), threads)); | |
| 331 | } | ||
| 332 | 7 | report.layers = std::move(timings); | |
| 333 | 14 | report.backend = std::string(BackendName(generated.backend)); | |
| 334 | 7 | report.threads = threads; | |
| 335 | 7 | report.seeds = LayerSeeds(config); | |
| 336 | 7 | report.seconds = generated.seconds; | |
| 337 | 7 | return report; | |
| 338 | 7 | } | |
| 339 | |||
| 340 | } // namespace | ||
| 341 | |||
| 342 | 16 | const GeneratedGrid& GeneratedOutputs::Grid() const { | |
| 343 | 16 | if (grids.size() != 1) { | |
| 344 | 4 | throw std::runtime_error("The outputs cover " + std::to_string(grids.size()) + | |
| 345 | 6 | " grids, not one; find a grid by its RasterGrid instead"); | |
| 346 | } | ||
| 347 | 14 | return grids.front(); | |
| 348 | } | ||
| 349 | |||
| 350 | 233 | const GeneratedGrid* GeneratedOutputs::Find(const RasterGrid& grid) const { | |
| 351 | 247 | for (const GeneratedGrid& generated : grids) { | |
| 352 | 130 | if (generated.grid == grid) { | |
| 353 | 233 | return &generated; | |
| 354 | } | ||
| 355 | } | ||
| 356 | return nullptr; | ||
| 357 | } | ||
| 358 | |||
| 359 | 180 | GeneratedGrid* GeneratedOutputs::Find(const RasterGrid& grid) { | |
| 360 | 180 | return const_cast<GeneratedGrid*>(std::as_const(*this).Find(grid)); | |
| 361 | } | ||
| 362 | |||
| 363 | 113 | GeneratedOutputs GenerateFromConfig(const TerrainGenConfig& value, | |
| 364 | const std::filesystem::path& given, unsigned threads, | ||
| 365 | std::optional<Backend> backend) { | ||
| 366 | 113 | const ConfigSpec& config = value.Spec(); | |
| 367 | 113 | const std::filesystem::path directory = ConfigDirectory(config, given); | |
| 368 | 115 | config::CheckedTerrain checked = config::BuildCheckedTerrain(config, directory); | |
| 369 | 111 | GeneratedOutputs generated{std::move(checked.terrain)}; | |
| 370 | 111 | generated.outputGrids = std::move(checked.summary.outputGrids); | |
| 371 | 116 | generated.backend = ResolveBackend(backend.value_or(DefaultBackend())); | |
| 372 | 111 | const Stopwatch stopwatch; | |
| 373 | 111 | OutputGenerator outputGenerator(config, generated, directory, threads, | |
| 374 | 111 | std::move(checked.outputs)); | |
| 375 | 304 | for (std::size_t i = 0; i < config.outputs.size(); ++i) { | |
| 376 | 193 | outputGenerator.Generate(i); | |
| 377 | } | ||
| 378 | 111 | generated.geoKeys = generated.terrain.Keys(); | |
| 379 | 111 | generated.seconds = stopwatch.Milliseconds() / 1000.0; | |
| 380 | 111 | outputGenerator.LogTimes(stopwatch.Milliseconds()); | |
| 381 | 111 | if (config::HasOutput<ReportOutput>(config.outputs)) { | |
| 382 | 7 | generated.report = BuildReport(config, generated, outputGenerator.LayerTimings(), threads); | |
| 383 | } | ||
| 384 | 222 | return generated; | |
| 385 | 222 | } | |
| 386 | |||
| 387 | 10 | std::string Summary(const GeneratedOutputs& generated) { | |
| 388 | 10 | std::vector<const Raster<float>*> heights; | |
| 389 | 20 | for (const GeneratedGrid& grid : generated.grids) { | |
| 390 | 10 | if (!grid.heights.Empty()) { | |
| 391 | 10 | heights.push_back(&grid.heights); | |
| 392 | } | ||
| 393 | } | ||
| 394 | 10 | std::ostringstream text; | |
| 395 | 10 | text << std::setprecision(3); | |
| 396 | 10 | if (heights.empty()) { | |
| 397 | 1 | text << "Generated the outputs, with no heights to evaluate,"; | |
| 398 | 9 | } else if (heights.size() == 1) { | |
| 399 | 8 | text << "Generated a " << heights[0]->Width() << "x" << heights[0]->Height() << " terrain"; | |
| 400 | } else { | ||
| 401 | 1 | text << "Generated " << heights.size() << " grids ("; | |
| 402 | 3 | for (std::size_t i = 0; i < heights.size(); ++i) { | |
| 403 | 3 | text << (i > 0 ? ", " : "") << heights[i]->Width() << "x" << heights[i]->Height(); | |
| 404 | } | ||
| 405 | 1 | text << ")"; | |
| 406 | } | ||
| 407 | 20 | text << " in " << generated.seconds << " s on " << DescribeBackend(generated.backend); | |
| 408 | 20 | return text.str(); | |
| 409 | 10 | } | |
| 410 | |||
| 411 | } // namespace terraingen | ||
| 412 |