| 394 | } |
| 395 | |
| 396 | void Mesh::FinalizeData() { |
| 397 | EnsureNotFinalized_(); |
| 398 | |
| 399 | PackCpuData(); |
| 400 | |
| 401 | if (ApplicationThread::Instance()->CurrentIsApplicationThread()) { |
| 402 | GenerateGpuData_(); |
| 403 | } |
| 404 | else { |
| 405 | ApplicationThread::Instance()->Queue([this]() { |
| 406 | GenerateGpuData_(); |
| 407 | }); |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | void Mesh::Render(size_t numInstances, const GpuArrayBuffer& additionalBuffers) const { |
| 412 | if (!IsFinalized()) return; |
no test coverage detected