| … | … | @@ -3211,19 +3211,32 @@ Ref<ArrayMesh> DCTerrain::bake_volume_mesh(const String &p_glsl, const Vector3 & |
| 3211 | 3211 | // terrain later enters game mode it finds gpu_thread_ non-null and reuses |
| 3212 | 3212 | // it. One device, ever. A second VkDevice is the 30.2 s starvation that |
| 3213 | 3213 | // left two meshers in one world (hyper-games #58). |
| 3214 | bool made_it_here = false; |
| 3214 | 3215 | if (!gpu_thread_) { |
| 3215 | 3216 | gpu_thread_ = std::make_unique<DCGpuThread>(); |
| 3216 | 3217 | gpu_thread_->start(); |
| 3218 | made_it_here = true; |
| 3219 | UtilityFunctions::print( |
| 3220 | "DCTerrain.bake_volume_mesh: no GPU thread existed, starting one " |
| 3221 | "(this instance was not streaming)."); |
| 3217 | 3222 | } |
| 3223 | (void)made_it_here; |
| 3218 | 3224 | if (!gpu_thread_->is_available()) { |
| 3219 | 3225 | // NON-BLOCKING ON PURPOSE. Bring-up takes seconds, and blocking a bound |
| 3220 | 3226 | // call for that freezes the frame -- the same "right total, wrong shape" |
| 3221 | 3227 | // mistake the worker deferral records. Return null and let the caller |
| 3222 | 3228 | // ask again. |
| 3223 | | UtilityFunctions::push_warning( |
| 3224 | | "DCTerrain.bake_volume_mesh: the GPU is still coming up. This " |
| 3225 | | "returns null rather than blocking the frame -- call again next " |
| 3226 | | "frame."); |
| 3229 | static uint64_t s_waits = 0; |
| 3230 | if ((s_waits++ % 600) == 0) { |
| 3231 | // THROTTLED. Polling this every frame is normal -- the caller |
| 3232 | // cannot know when the device is up -- but a warning per frame |
| 3233 | // buries the log and adds load to the very bring-up it is waiting |
| 3234 | // for. Measured in the full map: ready at 6.2 s, and the poll had |
| 3235 | // already logged 9601 times by then. |
| 3236 | UtilityFunctions::push_warning( |
| 3237 | "DCTerrain.bake_volume_mesh: GPU still coming up (poll #", |
| 3238 | (int64_t)s_waits, "). Returning null rather than blocking."); |
| 3239 | } |
| 3227 | 3240 | return out; |
| 3228 | 3241 | } |
| 3229 | 3242 | if (p_cells < 1) p_cells = 1; |