(mode)
| 401 | //TODO: |
| 402 | |
| 403 | function dynamicOutput2DGraphicalGrows(mode) { |
| 404 | const gpu = new GPU({ mode }); |
| 405 | const kernel = gpu.createKernel(function() { |
| 406 | this.color(1,1,1,1); |
| 407 | }, { graphical: true, dynamicOutput: true }); |
| 408 | |
| 409 | kernel.setOutput([2,2]); |
| 410 | kernel(); |
| 411 | let result = kernel.getPixels(); |
| 412 | assert.equal(result.length, 2 * 2 * 4); |
| 413 | assert.deepEqual(Array.from(result), [ |
| 414 | 255, 255, 255, 255, |
| 415 | 255, 255, 255, 255, |
| 416 | 255, 255, 255, 255, |
| 417 | 255, 255, 255, 255 |
| 418 | ]); |
| 419 | assert.deepEqual(Array.from(kernel.output), [2,2]); |
| 420 | |
| 421 | kernel.setOutput([3,3]); |
| 422 | kernel(); |
| 423 | result = kernel.getPixels(); |
| 424 | assert.equal(result.length, 3 * 3 * 4); |
| 425 | assert.deepEqual(Array.from(result), [ |
| 426 | 255, 255, 255, 255, |
| 427 | 255, 255, 255, 255, |
| 428 | 255, 255, 255, 255, |
| 429 | 255, 255, 255, 255, |
| 430 | 255, 255, 255, 255, |
| 431 | 255, 255, 255, 255, |
| 432 | 255, 255, 255, 255, |
| 433 | 255, 255, 255, 255, |
| 434 | 255, 255, 255, 255, |
| 435 | ]); |
| 436 | assert.deepEqual(Array.from(kernel.output), [3,3]); |
| 437 | |
| 438 | gpu.destroy(); |
| 439 | } |
| 440 | |
| 441 | test('dynamic output 2d graphical grows auto', () => { |
| 442 | dynamicOutput2DGraphicalGrows(); |
no test coverage detected
searching dependent graphs…