(mode)
| 38 | }); |
| 39 | |
| 40 | function canvasManuallyDefinedArgumentTest(mode) { |
| 41 | const gpu = new GPU({ mode }); |
| 42 | const canvas = greenCanvas(mode, 1, 1); |
| 43 | const kernel = gpu.createKernel(function(canvas) { |
| 44 | const pixel = canvas[this.thread.y][this.thread.x]; |
| 45 | return pixel[1]; |
| 46 | }, { |
| 47 | output : [canvas.width, canvas.height], |
| 48 | argumentTypes: { canvas: 'HTMLCanvas' } |
| 49 | }); |
| 50 | const result = kernel(canvas); |
| 51 | assert.equal(result[0][0], 1); |
| 52 | gpu.destroy(); |
| 53 | } |
| 54 | |
| 55 | (typeof HTMLCanvasElement !== 'undefined' ? test : skip)('manually defined auto', () => { |
| 56 | canvasManuallyDefinedArgumentTest(); |
no test coverage detected
searching dependent graphs…