(mode)
| 4 | describe('features: read from texture'); |
| 5 | |
| 6 | function readWithoutTextureKernels(mode) { |
| 7 | const gpu = new GPU({ mode }); |
| 8 | |
| 9 | function add(m, n) { |
| 10 | return m + n; |
| 11 | } |
| 12 | |
| 13 | const kernels = gpu.createKernelMap({ |
| 14 | addResult: add |
| 15 | }, function (a, b) { |
| 16 | return add(a[this.thread.x], b[this.thread.x]); |
| 17 | }) |
| 18 | .setOutput([5]); |
| 19 | const result = kernels([1, 2, 3, 4, 5], [1, 2, 3, 4, 5]); |
| 20 | const nonTextureResult = result.addResult; |
| 21 | assert.deepEqual(Array.from(result.result), [2, 4, 6, 8, 10]); |
| 22 | assert.deepEqual(Array.from(nonTextureResult), [2, 4, 6, 8, 10]); |
| 23 | gpu.destroy(); |
| 24 | } |
| 25 | |
| 26 | (GPU.isKernelMapSupported ? test : skip)('Read without texture auto', () => { |
| 27 | readWithoutTextureKernels(); |
no test coverage detected
searching dependent graphs…