| <!-- webkit-test-runner [ enableMetalShaderValidation=true ] --> |
| <script src="../../../resources/js-test-pre.js"></script> |
| <script> |
| async function run() { |
| let adapter = await navigator.gpu.requestAdapter(); |
| let device = await adapter.requestDevice(); |
| let canvas = document.createElement('canvas'); |
| canvas.getContext('2d'); |
| let texture = device.createTexture({ |
| size: { width: 1 }, |
| dimension: '1d', |
| format: 'rg16uint', |
| usage: GPUTextureUsage.COPY_DST | GPUTextureUsage.COPY_SRC | GPUTextureUsage.TEXTURE_BINDING, |
| viewFormats: [], |
| }); |
| device.queue.copyExternalImageToTexture( |
| { source: canvas, origin: { x: 1, y: 1 } }, |
| { texture: texture, origin: {}, aspect: 'all' }, |
| { width: 0, height: 0, depthOrArrayLayers: 0 } |
| ); |
| await device.queue.onSubmittedWorkDone(); |
| debug('Pass') |
| globalThis.testRunner?.notifyDone(); |
| } |
| |
| globalThis.testRunner?.dumpAsText(); |
| globalThis.testRunner?.waitUntilDone(); |
| |
| run(); |
| </script> |
| |