(mode)
| 165 | |
| 166 | |
| 167 | function getPixelsFlipped(mode) { |
| 168 | const gpu = new GPU({ mode }); |
| 169 | const kernel = gpu.createKernel(function(v) { |
| 170 | this.color( |
| 171 | v[this.thread.y][this.thread.x][0], |
| 172 | v[this.thread.y][this.thread.x][1], |
| 173 | v[this.thread.y][this.thread.x][2] |
| 174 | ); |
| 175 | }, { |
| 176 | output: [2,2], |
| 177 | graphical: true, |
| 178 | }); |
| 179 | kernel([ |
| 180 | [ |
| 181 | [.02,.04,.06,.08], |
| 182 | [.10,.12,.14,.16] |
| 183 | ], |
| 184 | [ |
| 185 | [.18,.20,.22,.24], |
| 186 | [.26,.28,.30,.32] |
| 187 | ] |
| 188 | ]); |
| 189 | const pixels = Array.from(kernel.getPixels(true)); |
| 190 | gpu.destroy(); |
| 191 | return pixels; |
| 192 | } |
| 193 | |
| 194 | |
| 195 | test('flipped auto', () => { |
no test coverage detected
searching dependent graphs…