Skip to main content

Module bake_pool

Module bake_pool 

Source
Expand description

Background chunk-surface baking (the fast-flight stutter fix), generic over any CpuSurfaceProvider.

Baking a chunk’s surface costs several ms (a CPU fBm evaluation, …); running it on the main thread capped fast flight to a handful of admissions per frame. This pool moves the work onto worker threads: the planet enqueues bake jobs for chunks it wants to admit, and only admits a chunk into the GPU cache once its surface is READY — ancestor stand-ins cover the ground in the meantime, so delayed admission is invisible.

The pool is provider-agnostic: every worker calls CpuSurfaceProvider::bake, and all source-specific state (tile caches, streaming, height scaling) lives behind the provider.

Structs§

BakePool
Worker pool resampling chunk surfaces off the main thread.
BakeResult
One bake outcome. surface == None means the job was CANCELLED (its chunk left the wanted set before a worker got to it) — the in-flight entry is released so the chunk re-queues if it comes back into view.