({ gpuTexture }, source)
| 2450 | } |
| 2451 | |
| 2452 | uploadTextureFromSource({ gpuTexture }, source) { |
| 2453 | this.queue.copyExternalImageToTexture( |
| 2454 | { source }, |
| 2455 | { texture: gpuTexture }, |
| 2456 | [source.width, source.height] |
| 2457 | ); |
| 2458 | |
| 2459 | // Force submission to ensure texture upload completes before usage |
| 2460 | this._hasPendingDraws = true; |
| 2461 | this.flushDraw(); |
| 2462 | } |
| 2463 | |
| 2464 | uploadTextureFromData({ gpuTexture }, data, width, height) { |
| 2465 | this.queue.writeTexture( |