* Flush all pending compute passes by finishing and submitting the * accumulated command encoder. * * Must be called before: * - GPU→CPU readback (deviceCopyFromGPU) * - CPU→GPU writes (deviceCopyToGPU, copyRawBytesToBuffer) * - GPU↔GPU copies (deviceCopyWithinGPU) * - Buffer de
()
| 466 | * - Queue sync (sync) |
| 467 | */ |
| 468 | flushCommands(): void { |
| 469 | if (this.pendingEncoder) { |
| 470 | this.device.queue.submit([this.pendingEncoder.finish()]); |
| 471 | this.pendingEncoder = null; |
| 472 | this.pendingDispatchCount = 0; |
| 473 | // A compute submission is now the last queue operation, so the |
| 474 | // GPU→CPU copy fast path in sync() is no longer valid. |
| 475 | this.pendingGPUToCPUCopy = null; |
| 476 | } |
| 477 | } |
| 478 | |
| 479 | /** |
| 480 | * Dispose context. |
no test coverage detected