(mode)
| 51 | |
| 52 | |
| 53 | function wrongCanvasSizeUnoptimized(mode) { |
| 54 | const gpu = new GPU({ mode }); |
| 55 | |
| 56 | const initMatrix = gpu.createKernel(function(value) { |
| 57 | return value; |
| 58 | }) |
| 59 | .setOptimizeFloatMemory(false) |
| 60 | .setOutput([WIDTH, HEIGHT]); |
| 61 | |
| 62 | const render = gpu.createKernel(function(matrix) { |
| 63 | const i = matrix[this.thread.y][this.thread.x]; |
| 64 | this.color(i, i, i, 1); |
| 65 | }) |
| 66 | .setOutput([WIDTH, HEIGHT]) |
| 67 | .setGraphical(true); |
| 68 | |
| 69 | const matrix = initMatrix(0.5); |
| 70 | render(matrix); |
| 71 | const canvas = render.canvas; |
| 72 | assert.equal(canvas.width, WIDTH); |
| 73 | assert.equal(canvas.height, HEIGHT); |
| 74 | gpu.destroy(); |
| 75 | } |
| 76 | |
| 77 | (GPU.isCanvasSupported ? test : skip)('Issue #279 wrong canvas size unoptimized - cpu', () => { |
| 78 | wrongCanvasSizeUnoptimized('cpu'); |
no test coverage detected
searching dependent graphs…