(mode)
| 196 | }); |
| 197 | |
| 198 | function testArray2D3(mode) { |
| 199 | const gpu = new GPU({ mode }); |
| 200 | const texture = ( |
| 201 | gpu.createKernel(function() { return [this.thread.x, this.thread.y, this.thread.x * this.thread.y]; }) |
| 202 | .setOutput([10, 10]) |
| 203 | .setPipeline(true) |
| 204 | .setPrecision('single') |
| 205 | )(); |
| 206 | const expected = texture.toArray(); |
| 207 | const kernel = gpu.createKernel(function() { |
| 208 | return this.constants.value[this.thread.y][this.thread.x]; |
| 209 | }) |
| 210 | .setConstants({ |
| 211 | value: texture |
| 212 | }) |
| 213 | .setConstantTypes({ |
| 214 | value: 'Array1D(2)' |
| 215 | }) |
| 216 | .setOutput([10, 10]) |
| 217 | .setPipeline(false) |
| 218 | .setPrecision('single'); |
| 219 | |
| 220 | assert.notEqual(texture.constructor, Array); |
| 221 | assert.equal(expected.constructor, Array); |
| 222 | assert.deepEqual(kernel(), expected); |
| 223 | gpu.destroy(); |
| 224 | } |
| 225 | |
| 226 | (GPU.isSinglePrecisionSupported ? test : skip)('Array2D(3) (GPU only) auto', () => { |
| 227 | testArray2D3(); |
no test coverage detected
searching dependent graphs…