(mode)
| 4 | describe('features: getPixels'); |
| 5 | |
| 6 | function getPixelsStandard(mode) { |
| 7 | const gpu = new GPU({ mode }); |
| 8 | const kernel = gpu.createKernel(function(v) { |
| 9 | this.color( |
| 10 | v[this.thread.y][this.thread.x][0], |
| 11 | v[this.thread.y][this.thread.x][1], |
| 12 | v[this.thread.y][this.thread.x][2] |
| 13 | ); |
| 14 | }, { |
| 15 | output: [2,2], |
| 16 | graphical: true, |
| 17 | }); |
| 18 | kernel([ |
| 19 | [ |
| 20 | [.02,.04,.06,.08], |
| 21 | [.10,.12,.14,.16] |
| 22 | ], |
| 23 | [ |
| 24 | [.18,.20,.22,.24], |
| 25 | [.26,.28,.30,.32] |
| 26 | ] |
| 27 | ]); |
| 28 | const pixels = Array.from(kernel.getPixels()); |
| 29 | gpu.destroy(); |
| 30 | return pixels; |
| 31 | } |
| 32 | |
| 33 | |
| 34 | test('standard auto', () => { |
no test coverage detected
searching dependent graphs…