* Wait for all pending GPU tasks to complete
()
| 502 | * Wait for all pending GPU tasks to complete |
| 503 | */ |
| 504 | async sync(): Promise<void> { |
| 505 | // Flush any batched compute passes before waiting on the queue. |
| 506 | this.flushCommands(); |
| 507 | if (this.pendingGPUToCPUCopy) { |
| 508 | const p = this.pendingGPUToCPUCopy; |
| 509 | this.pendingGPUToCPUCopy = null; |
| 510 | await p; |
| 511 | } else { |
| 512 | await this.device.queue.onSubmittedWorkDone(); |
| 513 | } |
| 514 | } |
| 515 | |
| 516 | /** |
| 517 | * Obtain the runtime information in readable format. |
no test coverage detected