(mode)
| 313 | }); |
| 314 | |
| 315 | function arrayTexture2(mode) { |
| 316 | const gpu = new GPU({ mode }); |
| 317 | function addOne(functionValue) { |
| 318 | const declaredValue = functionValue[this.thread.x]; |
| 319 | return declaredValue[0] + 1 + declaredValue[1] + 1; |
| 320 | } |
| 321 | gpu.addFunction(addOne); |
| 322 | const texture1 = gpu.createKernel(function() { |
| 323 | return [1,2]; |
| 324 | }, { |
| 325 | output: [1], |
| 326 | precision: 'single', |
| 327 | pipeline: true, |
| 328 | })(); |
| 329 | if (mode !== 'cpu') { |
| 330 | assert.equal(texture1.type, 'ArrayTexture(2)'); |
| 331 | } |
| 332 | |
| 333 | const kernel = gpu.createKernel(function(kernelValue) { |
| 334 | return addOne(kernelValue); |
| 335 | }, { output: [1] }); |
| 336 | const result = kernel(texture1); |
| 337 | assert.equal(result[0], 5); |
| 338 | gpu.destroy(); |
| 339 | } |
| 340 | |
| 341 | (GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(2) auto', ()=> { |
| 342 | arrayTexture2(); |
no test coverage detected
searching dependent graphs…