(mode, context, canvas)
| 4 | describe('issue #263'); |
| 5 | |
| 6 | function toString(mode, context, canvas) { |
| 7 | const gpu = new GPU({ mode, context, canvas }); |
| 8 | const kernel = gpu.createKernel(function() { |
| 9 | return 1; |
| 10 | }, { |
| 11 | output: [1] |
| 12 | }); |
| 13 | kernel.build(); |
| 14 | const string = kernel.toString(); |
| 15 | const kernel2 = new Function('return ' + string)()({ context, canvas }); |
| 16 | const result = kernel2(); |
| 17 | assert.equal(result[0], 1); |
| 18 | gpu.destroy(); |
| 19 | } |
| 20 | |
| 21 | (GPU.isWebGLSupported ? test : skip)('Issue #263 toString single function - webgl', () => { |
| 22 | const canvas = document.createElement('canvas'); |
no test coverage detected
searching dependent graphs…