2022-08-11 06:22:27 +08:00
|
|
|
function loaderProcess(loader, scene) {
|
2021-08-13 06:42:57 +08:00
|
|
|
// Normally scene is responsible for resetting the job scheduler every frame
|
|
|
|
|
// but since we're not calling scene.renderForSpecs we need to reset budgets
|
|
|
|
|
// explicitly. This is only required for loaders that use the job scheduler
|
|
|
|
|
// like GltfVertexBufferLoader, GltfIndexBufferLoader, and GltfTextureLoader
|
|
|
|
|
scene.jobScheduler.resetBudgets();
|
2023-03-09 04:58:23 +08:00
|
|
|
const ready = loader.process(scene.frameState);
|
2021-08-13 06:42:57 +08:00
|
|
|
scene.jobScheduler.resetBudgets();
|
2023-03-09 04:58:23 +08:00
|
|
|
return ready;
|
2021-08-13 06:42:57 +08:00
|
|
|
}
|
2022-08-11 06:22:27 +08:00
|
|
|
|
|
|
|
|
export default loaderProcess;
|