(mode)
| 4 | |
| 5 | describe('features: canvas argument'); |
| 6 | function canvasArgumentTest(mode) { |
| 7 | const gpu = new GPU({ mode }); |
| 8 | const canvas = greenCanvas(mode, 1, 1); |
| 9 | const kernel = gpu.createKernel(function(canvas) { |
| 10 | const pixel = canvas[this.thread.y][this.thread.x]; |
| 11 | return pixel[1]; |
| 12 | }, { |
| 13 | output : [canvas.width, canvas.height] |
| 14 | }); |
| 15 | const result = kernel(canvas); |
| 16 | assert.equal(result[0][0], 1); |
| 17 | gpu.destroy(); |
| 18 | } |
| 19 | |
| 20 | (typeof HTMLCanvasElement !== 'undefined' ? test : skip)('auto', () => { |
| 21 | canvasArgumentTest(); |
no test coverage detected
searching dependent graphs…