(mode)
| 269 | }); |
| 270 | |
| 271 | function arrayTexture1(mode) { |
| 272 | const gpu = new GPU({ mode }); |
| 273 | function addOne(functionValue) { |
| 274 | return functionValue[this.thread.x] + 1; |
| 275 | } |
| 276 | gpu.addFunction(addOne); |
| 277 | const texture1 = gpu.createKernel(function() { |
| 278 | return 1; |
| 279 | }, { |
| 280 | output: [1], |
| 281 | precision: 'single', |
| 282 | pipeline: true, |
| 283 | })(); |
| 284 | if (mode !== 'cpu') { |
| 285 | assert.equal(texture1.type, 'ArrayTexture(1)'); |
| 286 | } |
| 287 | |
| 288 | const kernel = gpu.createKernel(function(kernelValue) { |
| 289 | return addOne(kernelValue); |
| 290 | }, { output: [1] }); |
| 291 | const result = kernel(texture1); |
| 292 | assert.equal(result[0], 2); |
| 293 | gpu.destroy(); |
| 294 | } |
| 295 | |
| 296 | (GPU.isSinglePrecisionSupported ? test : skip)('ArrayTexture(1) auto', ()=> { |
| 297 | arrayTexture1(); |
no test coverage detected
searching dependent graphs…