MCPcopy Create free account
hub / github.com/esengine/esengine / flushCommandBuffers

Method flushCommandBuffers

packages/core/src/ECS/Scene.ts:576–589  ·  view source on GitHub ↗

* 执行所有系统的延迟命令 * Flush all systems' deferred commands * * 在帧末统一执行所有通过 CommandBuffer 提交的延迟操作。 * Execute all deferred operations submitted via CommandBuffer at end of frame.

(systems: readonly EntitySystem[])

Source from the content-addressed store, hash-verified

574 * Execute all deferred operations submitted via CommandBuffer at end of frame.
575 */
576 private flushCommandBuffers(systems: readonly EntitySystem[]): void {
577 const flushHandle = ProfilerSDK.beginSample('Scene.flushCommandBuffers', ProfileCategory.ECS);
578 try {
579 for (const system of systems) {
580 try {
581 system.flushCommands();
582 } catch (error) {
583 this._logger.error(`Error flushing commands for system ${system.systemName}:`, error);
584 }
585 }
586 } finally {
587 ProfilerSDK.endSample(flushHandle);
588 }
589 }
590
591 /**
592 * 处理系统执行错误

Callers 1

updateMethod · 0.95

Calls 3

beginSampleMethod · 0.80
endSampleMethod · 0.80
errorMethod · 0.45

Tested by

no test coverage detected